#include<stdio.h>
#include<conio.h>
void main()
{
float time;
printf("Enter the time = ");
scanf("%f",&time);
if(time<=12)
{
printf("Good Morning");
}
else if(time>12&&time<=18)
{
printf("Good Afternoon");
}
else if(time>18&&time<=22)
{
printf("Good evining");
}
else if(time>22&&time<=24)
{
printf("Good Night");
}
getch();
}
OUTPUT :-
#include<conio.h>
void main()
{
float time;
printf("Enter the time = ");
scanf("%f",&time);
if(time<=12)
{
printf("Good Morning");
}
else if(time>12&&time<=18)
{
printf("Good Afternoon");
}
else if(time>18&&time<=22)
{
printf("Good evining");
}
else if(time>22&&time<=24)
{
printf("Good Night");
}
getch();
}
OUTPUT :-