Conversion of flowchart to C program: Display Good morning message based on given time.
#include<stdio.h>
int main()
{
int time;
printf("Enter your time:");
scanf("%d",&time);
if(time < 12)
{
printf("Good Morning...");
}
return 0;
}
Output of the Program:
Enter your time:10
Good Morning...
write a program to accept name and display the name with good morning
ReplyDeleteDear Manish,
DeleteC program for accepting name and display name with good morning message is posted today at following URL:
http://cprogrampracticals.blogspot.in/2016/12/accept-name-and-display-name-with-good.html
Thanks and regards,
Creat a program that will allow the user to enter a country and the program will display the message good
Delete👌
ReplyDeleteThere is mistake how it can be <12
ReplyDeleteThanks for your input.
DeleteAs this is basic program to introduce use of "if statement" and "< operator" hence more conditions are not added in the program. We can always add more conditions by adding more statements like if(time > 4 && time < 12) to display appropriate greeting message.
This is great I prefer you add more statements like if(time >4 && time < 12) that will be better
ReplyDeleteThank you for your inputs. Updated program will be uploading soon.
DeletePlease write the program by system time
ReplyDeleteGd morning
ReplyDelete