What's new

Closed Help po mga sir, baguhan palang po ako kaya diko alam pano ifix.

Status
Not open for further replies.

Mr_Ch3ck3r

Honorary Poster
Joined
Aug 31, 2017
Posts
296
Reaction
28
Points
143
Age
22
1569641421729.png

#include<stdio.h>
int main()
{
char menu, fname, lname, mname, age, gender, bday, sno, college, shs, jhs;
printf("Welcome To OLFU Alumni Registration System!!");
printf("\n\nHello, would you like to: \n");
printf("\n ____________________");
printf("\n| Please Choose! |");
printf("\n|____________________|");
printf("\n| |");
printf("\n| A.NEW |");
printf("\n| B.OLD |");
printf("\n| C.EXIT |");
printf("\n| |");
printf("\n|____________________|");
printf("\n PLEASE TYPE: ");
scanf("%s",&menu);
switch (menu){
case 'A':
printf("Please Fill Up The Following");
printf("\nFirst Name: ");
gets ("fname");
break;
case 'B':
printf("Please Type Your Alumni Id Number:");
break;
case 'C':
printf("Thank You For Using The OLFU Alumni Registration System");
break;
}

}
 

Attachments

Nun mag-scanf ka dito:

C:
...
printf("\n PLEASE TYPE: ");
scanf("%s",&menu);

Nasa buffer pa din yung '\n' char. So para ma-consume yun, try to add getchar() past scanf like this:
C:
printf("\n PLEASE TYPE: ");
scanf("%s",&menu);
getchar();

Note: Don't use gets(). It is dangerous!
 
Status
Not open for further replies.
Back
Top