
Question
Accept the Name and Age of the Given Person and Print them in the Following Format Name: Age
Sample TestCase Expected Output
1. Mr X 21Mr X: 21
2. Mr Y 22Mr Y: 22
Answer
#include <stdio.h>#include <string.h>int main(){ char str[100]; int age;
scanf("%s %d",str,&age); printf("%s: %d",str,age); return 0;}
This comment has been removed by a blog administrator.
ReplyDelete