GROUPCASE
GROUPCASE
h>
2 #include<conio.h>
3 main(void)
4 {
5 int Rcmmd=0;
6 printf("Please enter 1 if recommendee of Jedi Master Obi Wan and 0 if
7 not recommendee");
8 scanf("%d", &Rcmmd);
9 if(Rcmmd == 0)
10 { int Hght=0;
11 printf("\n Please Enter Height in Cm");
12 scanf("%d",&Hght);
13 {if(Hght>=200)
14 { int Ag3=0;
15 printf("\n Please Enter Age");
16 scanf("%d",&Ag3);
17 if (Ag3>=21 && Ag3<=25)
18 {int CTzen=0;
19 printf("\n Please Type 1 if citizen of Planet Endor and
20 0 if not");
21 scanf("%d",&CTzen);
22 if (CTzen==1)
23 {printf("Applicant is Accepted");}
24 else if (CTzen==0)
25 {printf("\n Applicant is Rejected");}
26 else
27 {printf("\n Invalid Input");}
28 }
29 else
30 {printf("\n Applicant is Rejected");}
31 }
32 else
33 {printf("\n Applicant is Rejected");}
34 }
35 }
36 else if (Rcmmd == 1)
37 {printf("\n Applicant is Accepted");}
38
39 else
40 {printf("\n Invalid");}
41 getch();
42 }
1 #include <stdio.h>
2 #include <conio.h>
3 main(void)
4 { int Time_Sec=0, Dis_Origin=0;
5 printf("Please enter the Time in Seconds");
6 scanf("%d", &Time_Sec);
7
8 if(Time_Sec>=0)
9 {if(Time_Sec==1)
10 Dis_Origin=Time_Sec;
11 else if(Time_Sec%4==0)
12 {Dis_Origin=Time_Sec/2;}
13 else if(Time_Sec%3==0)
14 {Dis_Origin=Time_Sec/2+2;}
15 else if(Time_Sec%2==0)
16 {Dis_Origin=Time_Sec/2+1;}
17 else if(Time_Sec%1==0)
18 {Dis_Origin=Time_Sec/2+1;}
19 else;
20 printf("The Distance from Origin is = %dcm", Dis_Origin);
21 }
22
23 else if (Time_Sec<0)
24 {printf("Invalid Input, You must put positive number");}
25
26 else;
27 getch();
28 }
1 #include <stdio.h>
2 #include <stdlib.h>
3 main(void)
4 {int hour, minute;
5 // Read the time in 24-hour notation
6 printf("Enter a time in 24-hour notation Hour: Minute: ");
7 scanf("%d:%d", &hour, &minute);
8 // Check for invalid input
9 if (hour < 0 || hour > 23 || minute < 0 || minute > 59) {
10 printf("Invalid Time!\n");
11 return 0;
12 }
13 // Convert to 12-hour notation
14 if (hour == 0) {
15 // midnight
16 printf("The equivalent time in 12-hour notation is 12:%02d AM\n",
17 minute);
18 } else if (hour < 12) {
19 // AM
20 printf("The equivalent time in 12-hour notation is %d:%02d AM\n",
21 hour, minute);
22 } else if (hour == 12) {
23 // noon
24 printf("The equivalent time in 12-hour notation is 12:%02d PM\n",
25 minute);
26 } else {
27 // PM
28 printf("The equivalent time in 12-hour notation is %d:%02d PM\n",
29 hour-12, minute);
30 }
31 return 0;
32 }