Answer to Question #29199 in C++ for ashaba emmanuel

Question #29199
Write a c++ program that can be used to store and display marks of 80 students in a class
1
Expert's answer
2013-04-26T11:49:21-0400
#include <conio.h>
#include <iostream>


using namespace std;
//main function
int main()
{
int marks[80];//declare variable for marks

//fill random marks
for(int i=0;i<80;i++){
if(i%2==0){
marks[i]=80; //set 80
}
if(i%3==0){
marks[i]=50; //set 50
}
if(i%4==0){
marks[i]=65; //set 65
}else{
marks[i]=74;//set 74
}
}
//show result
for(int i=0;i<80;i++){
cout<<"Student "<<(i+1)<<" mark is
:"<<marks[i]<<"
";
}
getch();//delay
return 0;
}

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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS