#include"conio.h"
void main(){
char name[10];
char gender[10];
char lastname[10];
int age;
printf("type your first name:");
gets(name);
printf("type your last name:");
gets(lastname);
printf("type your age:");
scanf("%d", age);
printf("type your gender:");
gets(gender);
getch();
getch();
if(gender=="female"){
if(age<0){
printf("wrong age\r\n\r\n");
}
if(age==0){
printf("too little\r\n\r\n");
}
if(age>0&&age<10){
printf("this is the perfect age :3\r\n\r\n");
}
if(age>10&&age<17){
printf("what did you said? you are wet %s? let me change you\r\n\r\n", &firstname);
}
}else{
printf("nohomo xD\r\n\r\n");
}
system("pause");
}
Name:
Anonymous2014-02-05 14:18
I did a code review for you. My opinion is that using
char name[9];
char gender[9];
char lastname[9];
makes code shorter
Name:
Anonymous2014-02-05 14:42
top el
Name:
Anonymous2014-02-05 16:35
Use strncmp you fat fuck.
Name:
Anonymous2014-02-05 19:07
wut happend to:
else if { }
Name:
Anonymous2014-02-05 20:44
what if age is >17
Name:
Anonymous2014-02-05 22:22
my keks are in orbit
Name:
Anonymous2014-02-06 11:21
>>6
feel free to add
if(age<=17){
printf("too old\r\n\r\n");
}
Name:
Anonymous2014-02-06 22:58
>dem gets
>dat scanf
>dat non-portable system("pause")
>that fucking style
>void return type for main
>not #including stdio
>no address-of operator for scanf integer input
>dat strcmp with "=="
>not handling age > 17
>non-existent "firstname" variable
>dem windows newlines