Help please

I am new. Gets stuck on the number = 9 statement.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <stdio.h>
#include <math.h>
#include <stdlib.h>

int main() 
{
    int number();
    number = 9;
    printf ("%d \n");
    printf("Hello World\n");
    getchar();
    return(0);   
    system("pause"); 
}
Line 7 says that number is a function which takes no parameters and returns an int. Line 8 tries to assign to that function. Remove the parentheses on line 7.
I did that, but instead of getting 9, the number that came out was 4072544. Where did this number come from?

Edit: whoops meant 9 not 7
Last edited on
You can combine it to one line like...

int number = 9;

Also line 13 will never happen because of line 12. Return should always be the last line because it is like the exit command.
Last edited on
Line 9 is incorrect. It should be: printf("%d\n", number);
Thank you! It fixed it.
Topic archived. No new replies allowed.