Problem Description
Write a program to get the following details and print the same in the output.
Name, age, place, department
Input and Output Format:
Refer sample input and output for formatting specification.
All float values are displayed correct to 2 decimal places.
All text in bold corresponds to input and the rest corresponds to output.
CODING ARENA::
#include
<stdio.h>
int
main()
{
int a;
char b[20],c[20],d[20];
scanf("%s",b);
scanf("%d",&a);
scanf("%s",c);
scanf("%s",d);
printf("Name:%s",b);
printf("\nAge:%d",a);
printf("\nPlace:%s",c);
printf("\nDepartment:%s",d);
return 0;
}
Test Case 1
Input (stdin)
Rohitsharma
25
Mumbai
CSE
Expected Output
Name:Rohitsharma
Age:25
Place:Mumbai
Department:CSE
Test Case 2
Input (stdin)
Selvan
29
Tamilnadu
IT
Expected
Output
Name:Selvan
Age:29
Place:Tamilnadu
Department:IT
No comments:
Post a Comment