Saturday, 24 February 2018

Write a program to print your name, date of birth, mobile number and location using "char variable" and "printf" function.

Source Code : 

#include <stdio.h> 
main() 
{

char    name[]    =   "Devendra Singh"; 
char dob[] = "18 July 1990"; 
char mobile[] = "+91-9999999999"; 
char location[] = "India"; 

printf("Name \t\t : \t %s \n", name); 
printf("DOB \t\t : \t %s \n", dob); 
printf("Mobile \t\t : \t %s \n", mobile); 
printf("Location \t : \t %s \n", location); 

getchar();

}

Output : 
Name : Devendra Singh 
DOB : 18 July 1990 
Mobile : +91-9999999999 
Location : India


Click Here to download sample file.


Labels: , ,

Friday, 23 February 2018

Write a program to print your name, date of birth, mobile number and location using "printf" function.

Source Code :

#include    <stdio.h>
main()
{
    printf("Name   : Devendra Singh\n");
    printf("DOB    : July 18, 1990\n");
    printf("Mobile : +91-9999999999\n");
    printf("Location : India\n");

    getchar();
}


Output : 

Name   : Devendra Singh
DOB    : July 18, 1990
Mobile : +91-9999999999
Location : India


Click Here to download sample file.

Labels: , ,

C Programming Exercises

Beginners Level :

Labels: