

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The solutions for quiz #2 of the cmsc 106 course during the fall 2007 semester. The quiz includes two programming questions. The first question asks for the output of a given c program, and the second question asks for writing a c program to read and calculate the sum and average of three exam grades.
Typology: Quizzes
1 / 2
This page cannot be seen from the preview
Don't miss anything!


Name (printed):
Student ID #:
Section # (or TA’s: name and time)
17, 5, 3 and 2
7.5, 19.0 and 6.
#include <stdio.h>
int main(){ float ex1, ex2, ex3, sum, average; printf("give three exam grades: "); scanf("%f %f %f", &ex1, &ex2, &ex3); sum = ex1 + ex2 + ex3; average = sum/s; printf("The sum is %.1f and ", sum); printf("the average is %.1f.", average);
return 0; }