I write code in c
and
I am beginner in the case I think if(a==1,b<=8)
work like the control first check the value of a
if and it is true then check b
condition if both conditions are true then come into body but I think I did not know the accurate syntax to write that can anyone give me correct syntax.
here is my code:
#include <stdio.h>
#include <cono.h>
#include <iostream.h>
#include <stdlib.h>
void main(void)
{
int a, b;
printf("enter a");
scanf("%d",&a);
printf("enter b");
scanf("%d",&b);
if(a==1, b<=8)
{
printf("you");
exit(0);
}
if(a==2, 5<b<=10)
{
printf("you");
else
printf("me");
}
getch();
}
Expected result example:
If a
is equal to 2 so control check if b
is less than 10 and greater than 5 if it is so, control run if's true condition if not so control run else statement