-
Notifications
You must be signed in to change notification settings - Fork 20
/
ifelse.c
113 lines (105 loc) · 2.3 KB
/
ifelse.c
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#include<stdio.h>
int main()
{
//conditional statements :if ,if else ,else if ,nested if,switch
// syntax of if : if(condition){ statements }
// int age;
// printf("enter ur age :");
// scanf("%d",&age);
// if( age >= 18 ) //true block
// {
// printf("you are ready to vote \n");
// }
// ---------------------------------------------------------
// if-else syntax: if(condition){ statements }else{ statements }
// if(age>=18)
// {
// printf("you can vote !\n");
// }
// else
// {
// printf("you can't vote !\n");
// }
// ____________________________________________________
// else-if (ladder)
/* syntax:
if(condition1)
{
statements
}
else if(condition2)
{
statements
}
.
.
else
{
statements
}
*/
// float marks;
// printf("enter ur marks :");
// scanf("%f",&marks);
// if (marks>=90)
// {
// printf("u got admission in DU \n");
// }
// else if (marks>=80)
// {
// printf("Got admission in IPU");
// }
// else if(marks>=70)
// {
// printf("Got admission in Amity");
// }
// else if (marks>=50)
// {
// printf("IGNOU");
// }
// else
// {
// printf("Chai Becho");
// }
// //Nested if
float marks;
printf("enter ur marks :");
scanf("%f",&marks);
if (marks>=90)
{
printf("u got admission in DU \n");
if (marks>95)
{
printf("Got scholarship of 50k\n");
if (marks==100)
{
printf("no fee will be charged\n");
}
}
else if(marks>92)
{
printf("scholarship of 25k");
}
else if (marks>90)
{
printf("20k scholarship");
}
}
else if (marks>80)
{
printf("Got admission in IPU");
}
else if(marks>70)
{
printf("Got admission in Amity");
}
else if (marks>=33)
{
printf("IGNOU");
}
else
{
printf("Chai Becho");
}
return 0;
}