0
#include <iostream>
using namespace std;
int main(){


double w,x,y,z,avg;



cout <<" PLEASE ENTER FOUR ENTRIES OF MARKS"<<endl;
cin >> w >> x >> y >> z;


avg=((w+x+y+z)/4);
if(avg>60){
cout <<"YOU PASS"<<endl;}


else{
cout<<"YOU FAIL"<<endl;
}
cout<<"YOUR AVERAGE MARK IS "<<avg<< endl;


return 0;


}

Edited by happygeek: fixed formatting

3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by Necrolis
0

Think loop any time you want something to repeat. Just pick an appropriate control conditional for the loop and include any code you want to repeat within the body of the loop and you should be well on your way. If you don't already know there are three types of loops call for, while and do/while. Looking them up on a toutorial or in your favorite textbook is highly recommended.

0

if you want is to loop infinitely just stick the main part in a while loop and use a condition that is always true like:

while(1 == 1)
{
//your code
}

.

the do loop performs the operation first then checks the condition, useful for file ops.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.