Friday, May 5, 2017

C program to read name and address from user and display it on screen.

#include<stdio.h>
int main()
{
 int name,address;
 printf("Enter your name:");
 scanf("%s", &name);
 printf("Enter your address:");
 scanf("%s", &address);
 printf("Your name is: %s. \n",name);
 printf("Your address is: %s", address);
 return 0;
}


Output of program


Enter your name:Laxman Poudel
Enter your address:Butwal
Your name is:Laxman Poudel.
Your address is:Butwal

No comments:

Post a Comment