Lu Tiner: Sure, I will show you how to test variable using and (&&) oerator. This is the sample program for your concern, here i am providing you #include int main(){ // initialize variables and note that c is not less than d, which is one of the conditions to test for // therefore the entire expression should be evaluated as false int a = 5, b = 6, c = 5, d = 1; int x; // evaluate the expression without parentheses x = a printf("Given expression:"); printf("x = a printf("Without parentheses the expression evaluates as %d", x); // evaluate the expression with parentheses x = (a printf("With parentheses:"); printf("x = (a printf("With parentheses the expression evaluates as %d", x); return 0;}I hope, I served your question better, or ask me further if you find difficulties with it!...Show more
Jestine Osumi: Its likeif (condition1 && condition2)--------------------------------Some code to execute------! --------------------------Here, both condition must be true. Then only, statements written inside if will execute. For example,int a=5;if (a=1){ a=a+1;}Output: Here, both conditions for a is satisfying so value of a will be incremented to 1 by statement a=a+1;http://prembaranwal.com...Show more
Mayola Sylva: && In C
No comments:
Post a Comment