Monday 6 January 2014

First program in C

/* First C program  this line is a comment dont take part in programme */

#include<stdio.h>

int main(void)
  {
     printf("Welcome to C world !") ;
     return 0 ;
  } //end of main

Here your output in black screen
---------------------------------------------------------------------------------
Welcome to C world !
---------------------------------------------------------------------------------

Common Programming Error:-

Forgetting to terminate line or Comment */

Good Programming Practice:-
Every function  should be preceded by a comment which contain description about that function.

Detail about above program:-
1-#include--->is a directive to C preprocessor, here # are processed by the preprocessor before the program is compiled.Here we include standard input/output library(stdio.h) in the program.

2-int main -->is a part of every C program.paranthesis shows that starting of main and ending notation of main.Keep one thing in mind is that every C program executing at the main.


No comments:

Post a Comment

Compiler for C,C++ and Python {paste your programme to see the output}