How to Print "Hello World" and learn uses of "printf" in "C language".

 

Hello friend’s

Today we are going to learn about how to use “printf” function in “c language” printf function is used to print something like int , float , char , string , double  in short you want to print and value or character using printf function

This is very easy and very basic think in “c language” and also very important so let’s start learning about “printf” .

we all know about “c language” start means basic code write in c language which are common in every program (Basically we are include standard input output header file <stdio.h> and write  int main() function ,use {} barckets , then start the programme).

 

In this we are write code to print “hello world” and also write another code to write our “personal detail “ same way you can print any think by using our source code just replace whatever written in In double inverted comma.



1. Using Function "printf" write "Hello world"

#include <stdio.h>

int main()
{
    printf("Hello World");

    return 0;
}


2. Using Function "printf" write personal detail 

#include <stdio.h>
int main()
{
    printf("Name:________________\n");
    printf("Collage:________________\n");
    printf("Branch Name:_______________\n");
    printf("Subject:Fundamental of Computer Engineering\n");
    printf("Enrollment no:________________\n");
    printf("Grade:A\n");
    printf("Name:CGPA:8.5\n");
    return 0;
}

 

 

 

0 Comments