-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask1.cpp
More file actions
58 lines (53 loc) · 1.27 KB
/
task1.cpp
File metadata and controls
58 lines (53 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include <iostream>
using namespace std;
int main()
{
int eng,urdu,math,comp,isl;
float obtainedMarks, marksPerc;
int totalMarks = 500;
English:
cout << "Enter marks for English" << endl;
cin >> eng;
if (eng>100){
cout<<"enter marks below 100"<<endl;
goto English;
}
Urdu:
cout << "Enter marks for Urdu" << endl;
cin >> urdu;
if (urdu>100){
cout<<"enter marks below 100"<<endl;
goto Urdu;
}
Math:
cout << "Enter marks for Maths" << endl;
cin >> math;
if (math>100){
cout<<"enter marks below 100"<<endl;
goto Math;
}
Computer:
cout << "Enter marks for Computer" << endl;
cin >> comp;
if (comp>100){
cout<<"enter marks below 100"<<endl;
goto Computer;
}
Islamiat:
cout << "Enter marks for Islamiat" << endl;
cin >> isl;
if (isl>100){
cout<<"enter marks below 100"<<endl;
goto Islamiat;
}
obtainedMarks = eng + urdu + comp + math + isl;
marksPerc = (obtainedMarks / totalMarks) * 100;
cout << "Percentage is = " << marksPerc << "%" << endl;
if (marksPerc >= 50) {
cout << "Congratulations you are Passed" << endl;
}
else {
cout << "You are fail" << endl;
}
return 0;
}