- Introduction to Programming module has 3 online exams and you are suppose to write a C program to read the marks of a student for all 3 exams from the key board and display the total mark. Assume that the marks are in the range of 0 - 10. After entering the marks for one student, the program should ask from the user whether he/she wants to enter the marks of another student. If user saysj'y' or 'Y', the program should continue entering the marks. If user says 'n' or 'N' , the program should stop reading marks from the keyboard.
pls some one can code this simple programme..its urgent..im in exam
#include <stdio.h>
int main()
{
int exam1, exam2, exam3, total;
char ch;
do
{
printf("Enter the marks for exam 1: ");
scanf("%d", &exam1);
printf("Enter the marks for exam 2: ");
scanf("%d", &exam2);
printf("Enter the marks for exam 3: ");
scanf("%d", &exam3);
total = exam1 + exam2 + exam3;
printf("Total marks = %d", total);
printf("\nDo you want to enter marks for another student (y/n)? ");
scanf(" %c", &ch);
} while (ch == 'y' || ch == 'Y');
return 0;
}
It was really Simple.. If you cant really code this in 5 min you need to practice