Search Your C Program

Sunday, 22 January 2012

Program to Print "Programming Ville"

Starting with a simple program to print "Programming Ville" on the output screen :-

#include<stdio.h>
void main()
{
printf("Programming Ville");
getch();
}



Explanation:-

  • The first line is called pre-processor directive. Basically we are including a "header" file (i.e. stdio.h) that contain inbuilt functions(like printf). These lines tell the compiler to include the following files in the program while actual compilation.
  • The second line is the main function call. The "main" function is compulsory and has to be included in every program.
  • From the third line till seventh line, it is the content of the program. So they are included in "curly braces".
  • The Forth line is a function present in "stdio.h" header file. Printf is a function to print something on the output screen.
  • Getch() function in the fifth line is used to get the output on the screen.
  • The sixth line ends are program, Obviously...........



Note : If you are not aware of the functions used in the programs just search it on Google as
"[function_name] function in c". Example : "printf function in c" -OR- "getch function in c" .....
You may also read the instructions for some particular function in the Turbo C++ itself by pressing right click on that keyword in Turbo C++ IDE.

No comments:

Post a Comment