Hi, I want to perform the following algorithm but dont know where to place brackets and semicolons. Can someone show mw plz.
Code:if ( i > 20 ) if ( i == 10 ) printf( “Here I am...” );
Hi, I want to perform the following algorithm but dont know where to place brackets and semicolons. Can someone show mw plz.
Code:if ( i > 20 ) if ( i == 10 ) printf( “Here I am...” );
The example did not really make sense but heres a few guesses...
you don't always need the braces.Code:#include <stdio.h> int main() { int i; for(i = 0; i < 30; i++) { if(i > 20) { printf("i > 20 and equals %d\n", i); } if(i == 10) printf("i == 10\n"); } return 0; } }
maybe you want
Code:if(i>20 || i == 10) puts("Here I am");
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler