Tuesday, December 27, 2016

Accept name and display name with good morning message.

C program to accept name and display the name with good morning message.

#include<stdio.h>
int main()
{
  int time;
  char name[20];
 
  printf("Enter your name:");
  gets(name);
 
  printf("Enter time:");
  scanf("%d", &time);
 
  if(time < 12)
  {
     printf("Good Morning...%s", name);
  }
  return 0;
}

Output of the program:

Enter your name:Manish
Enter time:10
Good Morning...Manish




< HOME >

* * * * *

No comments:

Post a Comment