Sunday, 19 January 2020

‘C’ Programs | Welcome to C




Prog. 1 Displays the text "Welcome, Satara" on the screen.



/* This program will produce the same output as the program Hello.c. The only difference is that this program contains the comments. Comments are for the convenience of programmers only. The compiler simply neglects these comments.*/

#include <stdio.h>

main()

{

printf("Welcome, Satara \n");

return(0);

}

Output :

Welcome, Satara






Prog. 2 : Displays the text " Welcome, Satara " on the screen.

//  This program will produce the same output as program Hello. Only

//  difference is that this program contains the comments. Comments
//  are for the convenience of programmers only. Compiler simply
//  ignores these comments.

#include <stdio.h>

main()

{
printf("Welcome, Satara \n");
return(0);

}


Output :

Welcome, Satara





Prog. 3 : Displays three lines of text on the screen

#include <stdio.h>
main()
{

printf("Hello, C\n");
printf("Hello, C++\n");
printf("Hello, See\n");
return(0);
}


Output:

Hello, C

Hello, C++

Hello, See



Prog. 4 Displays a line of text on the screen.

#include <stdio.h>

main()

{

printf("Hello, Satara\n") ;

return(0) ;

}



Output :

Hello, Satara







 follow the blog for more programs on 'C'

No comments:

Post a Comment