Pages

Run the "Hello, World" program on your system. Experiment with leaving out parts of the program, to see what errer messages you get

Friday, 19 April 2013




// Run the "Hello, World" program on your system
#include <stdio.h>
#include <conio.h>
main()
{
      printf("Hello, World");
      getch();
}
<!--------END--------!>
// without header files errors
main()
{
      printf("Hello, World");
      getch();
}
errors:
1  'printf' undeclared function
2  'getch' undeclared function

<!--------END--------!>
// without main()
#include <stdio.h>
#include <conio.h>

{
      printf("Hello, World"); 
      getch();    
}
errors:
1  expected unqualified-id before '{' token 
2  expected `,' or `;' before '{' token 

<!--------END--------!>

// without semi colan (;)
#include <stdio.h>
#include <conio.h>
main()
{
      printf("Hello, World")
      getch() 
}
errors:
1    In function `int main()': 
2    expected `;' before "getch" 
 

Search Box

Most Reading

Contact Form

Name

Email *

Message *