Program description:
In this program we are going to take your name that is a string as input using the gets() function.
then we will take your age as as input then print both your name and age as a output.
Source code:
#include<stdio.h>int main()
{
int age;
char name[20];
printf("Enter your name:");
gets(name);
printf("Enter your age:");
scanf("%d",&age);
printf("Your name is %s and your age is %d",name,age);
return 0;
}
0 Comments