First program in c

Start programming in C

         This program will illustrate how to print out the message "welcome to the world of programming". (Instead of "welcome to the world of programming" you print anything you want).


#include<stdio.h>  /*header file*/
#include<conio.h>
void main()  /*main function*/
{
printf("welcome to the world of programming."); /*out put statement*/
getch();
}

Output:-
Welcome to the world of programming.
Explanation:-
#include<stdio.h> and #include<conio.h> is a special file called library function which contain information of predifine function such as printf() and scanf(). In C language there are many library function such as maths.h string.h etc. Every library function contain its own predifine function.
stdio:- standard input output (full form of stdio).

void main() declare the start of the function while the two curly bracket { } show the start and finish of the function.

printf() print the word on the screen. The text to be printed is enclosed in double quotes.

getch()/return0 It can be used to hold program execution, but the "holding" is simply a side-effect of its primary purpose, which is to wait until the user enters a character.Well as you know, getch() reads a single byte character from input. getch() is a way to get a user inputted character.

To write this program use turbo C or code block for pc and for android user use c compiler.

Key note:- stdio- standard input output.
                 conio- console input/output.

If any query or doubt comment below or drop email.

No comments

Powered by Blogger.