Program to display details of student like Roll Number, Name and subject Marks
Source Code:
#include <stdio.h>
#include <string.h>
struct student
{
int rollno;
int s1,s2,s3;
char name[20];
};
int main()
{
struct student s;
s.rollno=101;
s.s1=96;
s.s2=99;
s.s3=98;
strcpy(s.name,"Srinivas");
printf("Name:%s\nRollNo:%d\nSub1 Marks=%d\nSub2 Marks=%d\nSub3 Marks=%d\n",s.name,s.rollno,s.s1,s.s2,s.s3);
return 0;
}
Output:
Name:Srinivas
RollNo:101
Sub1 Marks=96
Sub2 Marks=99
Sub3 Marks=98
RollNo:101
Sub1 Marks=96
Sub2 Marks=99
Sub3 Marks=98
No comments:
Post a Comment