Tuesday, March 31, 2020

C Language

Print Hello World






#include<stdio.h>
#include<conio.h>
int main()
{
clrscr();
print("HELLO WORLD");
getch();
}

  • Output:
HELLO WORLD

Let us look at the various parts of the above program -


> #include<stdio.h> With this line of code we include a file called stdio.hThis file lets us use certain commands for input or output which we can use in our program.

> int main() The int is what is called the return value (in this case of the type integer).

   > printf("Hello World");The printf is used for printing things on the screen, in this case the words: Hello World. As you can see the data that is to be printed is put inside round brackets. The words Hello World are inside inverted ommas, because they are what is called a string.





0 comments:

Post a Comment