Hey guys!
I just began to learn programming in c (sorry for my gramma)
Right now I am trying out the if statement..
Somehow the statement "you are a kid" does not show, when I enter the age below 20.
Where is my mistake?? :S
Code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
char firstname[20];
char name[] = "Nick";
char age[3];
printf("Hello my name is %s. What is your name? \n" ,name);
scanf("%s", firstname);
printf("nice to meet you %s \n", firstname);
printf("How old are you? \n");
scanf("%d", age);
if ( age <= 20){
printf("You are a kid");
}
if ( age > 20){
printf("You are not a kid");
}
return 0;
}