Thursday, August 20, 2009

Writing a ‘C’ program without semicolon

from a C program with out using a semicolon in your problem…………….I guess you may say How can we?.Just go through the program below you can get the output.

write the program as

main( )

{

if( printf(”\n enter the matter you want to print here “) )

{

}

}

Thats it compile the program and execute it.You will get the output without using a semicolon.
Explanation:
Here we are placing the printf statement in the condition area of the IF statement thus when we enter into the if area , the condition is checked and thus as it is a printf statement the matter you type will be printed out on the system output.Thats it.

No comments:

Post a Comment