In: Computer Science
1a) assuming that the user is providing the GP value to the program
#include<stdlib.h>
#include<studio.h>
void main()
{
float GP;. //declaring a variable of type float
printf("Enter your Grade Point");
scanf("%f",&GP); //inputting the GP value from user
if(GP>=0.00 && GP<=1.49) //checking conditions
{
printf("FAIL");
}
else if (GP>=1.50 && GP<=4.00)
{
printf("PASS");
}
else
{
printf("invalid Input");
}
}
1b) assuming user is providing the month number to find the corresponding month name.
#include<stdlib.h>
#include<stdiomh>
void main()
{
int month_num; //decalring variable
printf("Enter the month number to find the corresponding month name");
scanf("%d",&month_num);
switch (month_num) //switch case begin
{
case 1:
printf("Muharram");
case 2:
printf("Safar");
case 3:
printf("Rabī al Awwal");
case 4:
printf("Rabī al Thani");
case 5:
printf("Jamada al Ula");
case 6:
printf("Jamada al Akhira");
case 7:
printf("Rajab");
case 8:
printf("Shaban");
case 9:
printf("Ramadan");
case 10:
printf("Shawwal");
case 11:
printf("Dhu al Qadah");
case 12:
printf("Dhu al Hijjah");
default: //to handle exceptions
printf("invalid Input");
} //Switch case end
}