I keep getting expected declaration or statement at end ofinput. #include #include int main() { int x,y;
Question:
I keep getting expected declaration or statement at end ofinput.
#include
#include
int main()
{
int x,y;
printf ("enter 2 numbers:");
//takes input of starting number from user
printf ("enter starting number:");
scanf("%d", &x);
//takes input of ending user
printf ("enter ending number: ");
scanf ("%d",&y);
//loop iterates till x is less than or equalto y
while(x<=y)
{
//printing current number
printf ("current number is:%d",x);
//condition to check if x iseven
if (x%2==0)
{
//printing current numberis even
printf ("currentnumber is even");
//multiplying thenumber with 3 and print result
printf("%",x*3);
}
else {// if x is odd
//printing currentnumber is odd
printf ("the currentnumber is odd");
//adding 10 to thenumber and print the result
printf("%d",x+10);}
//incrementing the x value
x++;
return 0;
}
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill