Official Site

click here to view our new site launched

Pages

Thursday, March 25, 2010

Code Challenge Solved

March 2010 Contest




March Coding Contest Solved


c










Beautiful coding:


What to know how to code without using semicolon?

void main(int a ,int b)
{
if(clrscr(),printf("\nEnter two integers:"),scanf("%d %d",&a,&b))
while(printf("\nSuccessful addition:%d",a+b),getch(),0)
{ }
}


Program without header file?


So continuing in the series of program without, here are two more programs. The first one is just a valid C program without any header file.
1int main()
2{
3 return 0;
4}
The above program will actually compile and run.
But you will say it did nothing. So lets have a program without header file which prints something.

01extern "C"
02{
03 int printf(const char *format,...);
04}
05
06int main()
07{
08 printf("Hello World");
09 return 0;
10}

4 comments:

  1. hi prabhu, could u make 5th question clear.I dont get ur question

    ReplyDelete
  2. Now i posted questions properly...if still u have doubts ask me..

    ReplyDelete
  3. not using semicolon in the sense there is any other unique way or we have to do it just using other options common in c and c++

    ReplyDelete
  4. A unique way is there for c or c++.But some statements are common in c and c++.

    ReplyDelete

$2.49 .COM at GoDaddy.com! Expires 5/14/13