Wednesday, August 10, 2016

C program to read and print your name and address.

C program to read and print your name and address.

#include<stdio.h>
#include<string.h>
int main()
{
  char name[20], address[80];
  printf("Enter your name:");
  gets(name);
  printf("Enter your address:");
  gets(address);

  printf("=====================\n");
  printf("Your name: %s \n",name);
  printf("Your address: %s\n", address);
  printf("=====================\n");

  return 0;
}

Output of the Program

Enter your name:ABC PATEL
Enter your address:11-PQR Society, Ahmedabad, India.
=====================
Your name: ABC PATEL
Your address: 11-PQR Society, Ahmedabad, India.
=====================

1 comment: