(i am new to programing in c)
( http://www.youtube.com/watch?v=DHtC4IkmPLw this link will explain what the real problem is. )
when i compile this peace of program i get a problem and that is when i run this program the problem is that it does not give me the correct output
And this is the program
( http://www.youtube.com/watch?v=DHtC4IkmPLw this link will explain what the real problem is. )
when i compile this peace of program i get a problem and that is when i run this program the problem is that it does not give me the correct output
And this is the program
Code:
#include<stdio.h> #include<conio.h> void main() { char c[15], d[15], f[15]; int age[2]; printf("Hello starshine the earth says hello.My name is willy wonka i shake you warmly by the hand."); printf("Please enter your age: "); scanf("%s",age); printf("ok now enter a prefered username of 9 letters only: "); scanf("%s",c); printf("ok now enter a prefered password: "); scanf("%s",d); printf("and the last step is the prefered name you would like to be known: "); scanf("%s",f); printf("Now we are going to munch all the information we have this may take a few seconds. "); switch ( age[2] ) { case '15': puts("Account successfuly created. "); break; case '16': puts("Account successfuly created. "); break; case '17': puts("Account successfuly created. "); break; case '18': puts("Account successfuly created. "); break; case '19': puts("Account successfuly created. "); break; case '20': puts("Account successfuly created. "); break; default: puts("you are too young/ too old to create an account."); } getch(); clrscr(); }
Comment