Simple C program

 In this program I will tell you how to write a simple  C program . For your comfort I also put down image of code and output .

Here I am using vs code which I very good IDE if you are beginner .

Code:

#include<stdio.h>
// sample C program 
int main(){

printf("I am reader\n");

    return 0;
}


Logic:

Here we write #include<stdio.h> because it is standard file for input and output .

And main is function which returns value in integers that why at the end of it we use return zero.

Third we use printf() because it is a function which is used to print any statement in c language as its name suggest .

Last \n is used to give line break or we can say after printing move control to next line .

Now you must think what is the output of this 

Output:


And this is the output and last one most important tip for you always end statement by ; otherwise compiler through us error .

I hope that you might find it helpful 

Thanks for reading .


No comments:

Post a Comment