Completely Solved C, C++ Programs Assignment.




C Program To Accept Student Roll No, Marks in 3 Subjects and Calculate Total, Average and Print it.

Filed Under:

Problem 3: C Program To Accept Student Roll No, Marks in 3 Subjects and Calculate Total, Average and Print it.
#include<stdio.h>
#include<conio.h>
main()
{
int r,b,c,d, tot, avg;
clrscr();
printf (“ENTER STUDENT RNO ; “);
scanf (“%d”,&r);
printf(“ENTER FIRST SUBJECT MARKS ;”);
scanf(“%d”,&b);
printf(“ENTER SECOND SUBJECT MARKS;”);
scanf(“%d”,&c);
printf(“ENTER THIRD SUBJECT MARKS ;”);
scanf(“%d”,&d);
tot=b+c+d;
avg=tot/3;
printf(“nntt MyComputerScience.Net –E-Learning Platformnn”);
printf(“t STUDENT RNO ; %d“,r);
printf(“t FIRST SUBJECT MARKS ;%d “,b);
printf(“t SECOND SUBJECT MARKS ;%d “,C);
printf(“t THIRD SUBJECT MARKS ;%d “,d);
printf(“t AVERAGE MARKS ; %d”, avg);
getch();
}
C compiler: gcc 4.1.2

Back to main directory: Sample C Program | Software Practical | Solved C Assignment


Get Free Programming Tutorials and Solved assignments