Problem Description
Write a C program to Store Information and Display it Using StructureCODING ARENA
#include <stdio.h>
int main()
{
struct student
{
char name[80];
int rollno;
float marks;
};
struct student s;
scanf("%s",s.name);
scanf("%d",&s.rollno);
scanf("%f",&s.marks);
printf("Name=%s\n",s.name);
printf("Roll number=%d\n",s.rollno);
printf("Marks=%.1f\n",s.marks);
return 0;
}
Test Case 1
Input (stdin)Abi 1001 99.5
Expected OutputName=Abi Roll number=1001 Marks=99.5
Test Case 2
Input (stdin)Akash 1002 90.3
Expected OutputName=Akash Roll number=1002 Marks=90.3
No comments:
Post a Comment