Write the above program using getchar() and gets().


#include<stdio.h>

#include<conio.h>

int main()

{

int rollno;

char gender;

char name[21];

printf(“Enter rollno : “); scanf(“%d”,&rollno);

printf(“Enter Name : “);fflush(stdin); gets(name);

printf(“Enter Gender [M/F] ? “);fflush(stdin);gender=getchar();

printf(“roll no is %d, Name is %s and Gender is %c”,rollno,name,gender);

 

getch();

}

Advertisements

One thought on “Write the above program using getchar() and gets().

  1. Another thing I have really noticed is that often for many people, a bad credit score is the response to circumstances above their control. For example they may happen to be saddled through an illness and because of this they have more bills for collections. Maybe it’s due to a occupation loss or inability to go to work. Sometimes divorce proceedings can truly send the financial situation in the wrong direction. Many thanks sharing your ideas on this blog site.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s