#include <limits.h>
if (1) {
printf ("INT_MAX is %d\n", INT_MAX);
printf ("LONG_MAX is %ld\n", LONG_MAX);
}
No. A violation in the syntax of a program statement is called a syntax error.
The only language, which has remark-statement, is BASIC. Syntax: REM any text
The conditional statement in foxpro is DID YOU GET IT
If(condition) { if-else statement; } else { if-else statement; }
REM any text
syntax: for(initialization;condition;increment) { statements s1; statements s2; } #include<stdio.h> main() { int i,n=5; for(i=0;i<n;i=i+1) { printf("the number s are %d", i); } }
It is one of the statements. Its syntax in BNF is the following: statement ::= for_statement for_statement ::= 'for' '(' opt_expression ';' expression ';' expression ')' statement
clearly:if () orif () else In each case, can be a null statement, a single statement, or a block of statements surrounded by braces, {}.
it's not a statement, it's a function: len= printf (format, ...more-parameters...);
You can use any number of if staments within a for-loop, eg: for (i=0; i<10; ++i) { if (i=1) printf ("%d=1\n",i); }
No. That would be a syntax error. Only a right semicolon (;) can go at the end of a statement.
No. A syntax error is a statement that fails to compile. Infinite loops are simply loops for which the number of iterations is unknown. However, all loops, whether counted loops or infinite loops, must have a reachable exit condition. If a loop does not have a reachable exit condition then it is a logic error, not a syntax error.