You are on page 1of 2

1.

15 EXAMPLES

PROBLEM-01

Write a program to print the sentence “Hello! Atiqur Rahman! How are you?” on the

screen.

Programming Code of the Solution:

Input and Output of the Executed Program:

Explanation of the Programming Code:

#include <stdio.h>

/*header file stdio.h contains prototype of the library function

printf(); the header file must be included using preprocessor

directive #include before the function is called in the program*/

int main(){

/*all C program must have a main() function with return type void

or int; here there is no parameter of the main() function and

Introduction ◾ 13

it returns an integer; opening curly brace specifies start of the

main() function and no statement before that curly brace is executed

by the compiler*/

printf("Hello! Atiqur Rahman!\n");

/*this displays the text in double quotes as it is on the screen

except for a newline replaces \n*/

printf("How are you?");

/*this displays the text in double quotes as it is on the

screen*/

return 0;

/*0 is returned as it is the standard for the successful

execution of the program*/

/*the closing curly brace specifies the end of the main() function’s
body, as well as the program’s end; after that curly brace, no

statement is executed*/

You might also like