Basic Conditional Checking for IF statements in C
- by ZaZu
Hi there,
Can someone please explain what really goes on in this code ?
If I put the AND statement, the message wont show if values are less than 0 or greater than 10 ... I think I must use 1 0 logic to work this out right ?
I just need someone to briefly explain it please.
#include<stdio.h>
main(){
puts("enter number");
scanf("%d",num);
if(num<0 || num >10)
puts("yay");
}
How is that IF statement different when AND is put :
#include<stdio.h>
main(){
puts("enter number");
scanf("%d",num);
if(num<0 && num >10)
puts("yay");
}
Thanks !!