Δημοσιεύτηκε: 13 Ιούλ 2011, 16:54
από stamatiou
Ναι αλλά το error λέει ότι είναι int και όχι char, και αν θέλω να δηλώσω string πρέπει ένα array για chars;
Αυτό είναι εκτός:
Έχω τον παρακάτω κώδικα:
Κώδικας: Επιλογή όλων
#include <stdio.h>

int main(void)
{
int i;
int input;
int sum = 1;
for(i = 0;i<10;i++)
{
printf("Insert the %d number:\n",i+1);
scanf("%d",&input);
if(input % sum == 0)
{
sum = sum + input;
}
}
printf("The sum of the numbers that are divided by 3 without leaving a remainder is %d\n",sum);
exit(0)
}

Και μου βγάζει error:
Κώδικας: Επιλογή όλων
Floating point exception

Αλλά αφού έχω κάνει compile και τρέξει το πρόγραμμα.