#include <stdio.h>
#include <stdlib.h>
int main()
{
int age;
char name[41];
printf("please enter your age \n");
scanf("%d", &age);
printf("you are %d years old\n", age);
if (!(age <= 19 && age >=13))
printf("you are not a teenager\n");
if (age > 19 || age < 13)
printf("you are not a teenager\n");
if (age == 10 || 20 || 30 >=100)
printf("you have a special age\n");
printf("please enter your name: ");
scanf("%s", name);
if (strcmp(name, "bruce") != 0 && age != 40); ///error on strcmp ??
printf("your name is bruce, can i call you bruce\n");
very_old = age > 80;
if (!very_old)
printf("you are not very old\n");
}
hi there trying to teach myself c ive got an error in strcmp line i cant understand why its there could someone please help
thanks
thank you for helping me ive read up on the commer
if (strcmp(name, "bruce") && age >= 13 && age <= 19)
printf("your name is bruce, you are the chosen one\n")
im still pulling my hair out trying to get this to work im thinking its something to do with the first %% the way i understand this works is if both strings compair result is 1 (boloon expression) and age is betweem 13 and 19, ive taken out the ! expression to make it a bit easer to understand