If(condition)
{
if-else statement;
}
else
{
if-else statement;
}
Yes, include files can be nested in C and C++. In fact, most library implementations do just that.
Yes.
There is no 'foreach' in C
s.
Its similar to a number of languages such as C, C++, Java and Perl.
C and C++ do it for ease of parsing. This way, when they hit a comment start of /*, the parser can trivially scan to the end. Otherwise, it would have to set up and maintain a stack, and then report errors if the comment tokens are unmatched. As to why Java does it, the answer is simple - Java's syntax was designed to emulate C and C++, to trick people into thinking it was just as fast (in the beginning, Java was purely interpreted, so this trick WAS necessary to get traction). If nested comments were allowed, it might trip up some C programmers, and many angry blog posts would be written!
cmd c:
syntax is the way you write your code in it defines the meaning of keywords & how to write
+ += - -= * *= / /= % %= = == != <= >= & && | ^ ~ << <<= >> >>= , [] () are the basic operator in TURBO C
In C a structure within a structure is called nested. For example, you can embed a while loop in another while loop or for loop in a for loop or an if statement in another if statement.
The nested loop.
Nesting can be a very handy tool in C++, but should be avoided if possible.C++ gives us If statements, For loops and many other things. These can be nested. For example:A nested If statement://outer if statementIf( this is true ){//nested if statementif( this is also true ){//do something}else{//do something else}}