Untitled
unknown
plain_text
a month ago
656 B
2
Indexable
Never
// Online C compiler to run C program online #include <stdio.h> #include<stdlib.h> struct student{ int rollno; char name[25]; int m1; int m2; int m3; }; void main() { struct student *ptr=(struct student*) malloc(1*(sizeof (struct student))); scanf("%d",&(ptr)->rollno); scanf("%s",(ptr)->name); scanf("%d",&(ptr)->m1); scanf("%d",&(ptr)->m2); scanf("%d",&(ptr)->m3); int totalmarks= (ptr->m1)+(ptr->m2)+(ptr->m3); //print printf("%d",(ptr)->rollno); printf("\n%s",(ptr)->name); printf("\n%d",(ptr)->m1); printf("\n%d",(ptr)->m2); printf("\n%d",(ptr)->m3); printf("\n%d",totalmarks); }
Leave a Comment