Topic: Problem (C programming)
i have a problem.
look at.
#include <stdio.h>
#include <string.h>
void main()
{
int yr_age;
printf("Enter your Age please");
scanf("%d",&yr_age);
if(yr_age<=15)
{
printf("Hello\n");
printf("your age is:");
printf( "%d",yr_age);
printf("\n");
}
else
printf("your age is not ok :)\n");
char benny,eliav,eli,ronit,name;
printf("Enter your Name");
scanf("%d,%d,%d,%d",&benny,&eliav,&eli,&ronit,&name);
if(benny)
printf("welcome");
else
printf("no");
}
i just start to learn i have a problem .
the program need to do :
enter your age.
if the age is biger from 15 it's will say "your age is not ok"
if it's ok is will wirte " Hello your age is : **"
all it's ok but this text no:
Enter a name:
if the name is not benny, eliav, eli or ronit it's will say "no" if the name is from the list it's will wirte "welcome"
it's not work why?
help plz.