Like us on google+

Thursday, 17 October 2013

Widgets

PRINT WITHOUT USING SEMICOLON

#include<stdio.h>
int main()
{
    if(printf("Hello world"))
    {
    }
 return 0;
}

----------------------------------------------------------
Explanation:If condition checks whether the return value of printf is greater than 0. printf prints Hello World and returns 11 (length of the string ).Hence if(printf("Hello world ")) prints Hello World.This can also done by using switch statement.

----------------------------------------------------------
#include<stdio.h>
int main()
{
    switch(printf("Hello world"))
    {
    }
return 0;
} 

SHARE THIS POST   

  • Facebook
  • Twitter
  • Myspace
  • Google Buzz
  • Reddit
  • Stumnleupon
  • Delicious
  • Digg
  • Technorati
About us:
Hi guys Sandesh and Rajesh here ... studing engineering in PESIT started this blog as a google contest and also we love blogging ...Hope u like it ...Encourage us by liking us on g+... Any queries dont hesitate to ask Read More →

0 comments: