Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

8/6/2021 Pastebin.com - Printed Paste ID: https://pastebin.

com/

1. //{===== Coded By Muradujjaman 202-35-651


==================}
2. #include <stdio.h>
3.  
4. int main() {
5.     //Declaring Initial Variables
6.     int phy, math, eng, prog, subj;
7.     int scholarship=0, count=0, option;
8.    
9.     //taking user input for subjects
10.     printf(" How many Subject Did you Take: ");
11.     scanf("%d", &subj);
12.    
13.     //setting up condition for input numbers of
subject
14.     if(subj==4){
15.  
16.             printf(" Enter the 4 subjects Marks:
\n\n");
17.            
18.             //taking the numbers for subjects
19.             printf(" Physics : ");
20.             scanf("%d", &phy);
21.             printf(" math : ");
22.             scanf("%d", &math);
23.             printf(" programming : ");
24.             scanf("%d", &prog);
25.             printf(" english : ");
26.             scanf("%d", &eng);
27.             printf("\n");

https://pastebin.com/print/NfdVcUb7 1/7
8/6/2021 Pastebin.com - Printed Paste ID: https://pastebin.com/

28.            
29.             //setting the condition for printing
results
30.             if(phy > 80){
31.                 printf(" you will get 5000 taka
in phy\n");
32.                 scholarship += 5000;
33.                 count++;
34.  
35.             }
36.             if (math > 85){
37.                 printf(" you will get 7000 taka
in math\n");
38.                 scholarship += 7000;
39.                 count++;
40.             }
41.             if (prog > 90){
42.                 printf(" you will get 9000 taka
in prog\n");
43.                 scholarship += 9000;
44.                 count++;
45.             }
46.             if (eng > 80){
47.                 printf("you will get 4000 taka
in eng\n");
48.                 scholarship += 4000;
49.                 count++;
50.             }
51.             printf("\n");
52.             if (count < 1){

https://pastebin.com/print/NfdVcUb7 2/7
8/6/2021 Pastebin.com - Printed Paste ID: https://pastebin.com/

53.                 printf(" you didn't get any


scholarship\n");
54.             }
55.                 printf(" your %d subject total
scholarship : %d",count, scholarship);
56.  
57.             }
58.            
59.             // Setting the last Condition for
getting scholarship
60.             if(count > 2){
61.                 printf("\n");
62.                 scholarship = 0;
63.                 printf("========================
WARNING =========================");
64.                 printf("\n you got required
marks in more than 2 subject\n");
65.                 printf(" you can choose only 2
subjects for Scholar ship\n");
66.                 printf(" 1) PHYSICS\n");
67.                 printf(" 2) MATH\n");
68.                 printf(" 3) PROGRAMMING\n");
69.                 printf(" 4) ENGLISH\n");
70.                
71.                 //taking user input for choosing
required no 1 subject number
72.                 printf("\n Please select the
subject 1 which you got required number: ");
73.                 scanf("%d", &option);
74.                 printf("\n");

https://pastebin.com/print/NfdVcUb7 3/7
8/6/2021 Pastebin.com - Printed Paste ID: https://pastebin.com/

75.                
76.                 //matching the conditions again
77.                 if(option == 1){
78.                     printf(" Please Enter Your
PHYSICS Number again : ");
79.                     scanf("%d", &phy);
80.                     if(phy > 80){
81.                     printf(" you will get 5000
taka in phy\n");
82.                     scholarship += 5000;
83.  
84.  
85.                     }
86.                 }
87.                 else if(option == 2){
88.                     printf("Please Enter Your
MATH Number again : ");
89.                     scanf("%d", &math);
90.                     if(math > 85){
91.                     printf(" you will get 7000
taka in MATH\n");
92.                     scholarship += 7000;
93.  
94.                     }
95.                 }
96.                 else if(option == 3){
97.                     printf("Please Enter Your
PROGRAMMING Number again : ");
98.                     scanf("%d", &prog);
99.                     if(prog > 90){

https://pastebin.com/print/NfdVcUb7 4/7
8/6/2021 Pastebin.com - Printed Paste ID: https://pastebin.com/

100.                     printf(" you will get 9000


taka in Prog\n");
101.                     scholarship += 9000;
102.  
103.                     }
104.                 }
105.                 else if(option == 4){
106.                     printf("Please Enter Your
ENGLISH Number again : ");
107.                     scanf("%d", &eng);
108.                     if(eng > 80){
109.                     printf(" you will get 4000
taka in eng\n");
110.                     scholarship += 4000;
111.  
112.  
113.                     }
114.                 }
115.                 printf("\n");
116.                
117.                 //taking user input for choosing
required no 1 subject number
118.                 printf(" Please select the
subject 2 which you got required number: ");
119.                 scanf("%d", &option);
120.                 printf("\n");
121.                 //matching the conditions again
122.                 if(option == 1){
123.                     printf(" Please Enter Your
PHYSICS Number again : ");

https://pastebin.com/print/NfdVcUb7 5/7
8/6/2021 Pastebin.com - Printed Paste ID: https://pastebin.com/

124.                     scanf("%d", &phy);


125.                     if(phy > 80){
126.                     printf(" you will get 5000
taka in phy\n");
127.                     scholarship += 5000;
128.  
129.  
130.                     }
131.                 }
132.                 else if(option == 2){
133.                     printf(" Please Enter Your
MATH Number again : ");
134.                     scanf("%d", &math);
135.                     if(math > 85){
136.                     printf(" you will get 7000
taka in MATH\n");
137.                     scholarship += 7000;
138.  
139.                     }
140.                 }
141.                 else if(option == 3){
142.                     printf(" Please Enter Your
PROGRAMMING Number again : ");
143.                     scanf("%d", &prog);
144.                     if(prog > 90){
145.                     printf(" you will get 9000
taka in Prog\n");
146.                     scholarship += 9000;
147.  
148.                     }

https://pastebin.com/print/NfdVcUb7 6/7
8/6/2021 Pastebin.com - Printed Paste ID: https://pastebin.com/

149.                 }
150.                 else if(option == 4){
151.                     printf(" Please Enter Your
ENGLISH Number again : ");
152.                     scanf("%d", &eng);
153.                     if(eng > 80){
154.                     printf(" you will get 4000
taka in eng\n");
155.                     scholarship += 4000;
156.  
157.  
158.                     }
159.                 }
160.                 printf("\n");
161.                 printf(" your total scholarship
: %d",scholarship); //printing the scholarship
162.             }
163.  
164.         else{
165.             printf(" You must take 4 subject");
166.  
167.         }
168.  
169.  
170.  
171.  
172.     return 0;
173. }

https://pastebin.com/print/NfdVcUb7 7/7

You might also like