Wednesday, September 17, 2008

Programming puzzle - 2

int main()
{
   if(condition)
   {
      printf("Hello!");
   }
   else
   {
      printf("mbvreddy");
   }
   return 0;
}

Write the condition in the above program such that output would be "Hello!mbvreddy"

2 comments:

Venkatesh Kavuluri said...

int main()

{

if(!printf("Hello!"))

{

printf("Hello!");

}

else

{

printf("mbvreddy");

}
return 0;
}

mbvreddy said...

correct.