76 804
Assignments Done
Successfully Done
In June 2019

Answer to Question #12965 in C++ for Gary

Question #12965
Hi!! How can i count the total marks for my user,which they are after answering almost 20 questions?
is it any C++ coding can help me to count the marks?
Expert's answer
Here is an example of C++ program that asks for 20 numbers and counts their sum:

#include <iostream.h>

bool even(int i){
if (i%2==0) return true;
else return false;

int s=0, a;
int i;

void main(){
for (i=1;i<21;i++){
& cout<<"enter mark "<<i<<": ";
& cin>>a;
& s+=a;
cout<<"\nSum of entered numbers is "<<s<<"\n";

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions