some one can write to me this programme in c

Feb 28, 2019
54
3
8
  • 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
 

Attachments

  • 2222222.png
    2222222.png
    756.9 KB · Views: 5

MrSam_1

Well-known member
Administrative
Trusted Seller
Dec 1, 2018
23,638
26,980
120
  • 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
 
  • Like
Reactions: counselme

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu