Practical-01
Write a c program to display “hello computer” on the screen.
Algorithm:
- Start
- Include header files stdio.h and conio.h
- Declare main function
- Print “Hello Computer”
- End
- Stop
#include <stdio.h>
#include <conio.h>
void main()
{
clrscr();
printf("Hello Computer");
getch();
}
Output:
Hello Computer
Explanation:
In this program, we have to print “Hello Computer” on the screen.
To print any message on the screen, we use printf() function.
The printf() function is defined in stdio.h header file.
So, we have to include stdio.h header file in our program. The printf() function is used to print the message on the screen. The message to be printed is enclosed in double quotes. The message to be printed is called a string. The string is enclosed in double quotes. The printf() function is terminated by a semicolon (;).