Code:
#include<stdio.h>
int num();
int main ()
{
int i, input, result;
printf("enter a number: ");
scanf("%d", &input);
result = input + num();
printf("your number %d + %d gives %d\n", input, num(), result);
return 0;
}
int num()
{
int i;
for(i=0;i<10;i++)
return i;
}
i want to display a number given by the user. the for loop in the function num should increase the number what is being added to the number given by the user. this happens ten times.
the output should look like this
your number 1 + 1 gives 2
your number 1 + 2 gives 3
your number 1 + 3 gives 4
i guess its a really simply mistake in the num function but i need help
threadhead