Write a program to input name (as a single character) and marks of three tests of a student (all integers). Then calculate and print the name and average (integer) of all test marks.
All
the test marks are integers and calculate average also as integer. That is you
need to print the integer part of average only, neglect the decimal part.
#include<iostream>
using
namespace std;
int
main()
{
int a,b,c;
char letter;
cin >> letter;
cin >> a >> b >> c;
int sum = a+b+c ;
int avg = sum/3;
cout << letter << endl;
cout << avg <<endl;
}
0 comments:
Post a Comment