March 2010 Contest
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.
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.
1 | int 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.
01 | extern "C" |
02 | { |
03 | int printf ( const char *format,...); |
04 | } |
05 |
06 | int main() |
07 | { |
08 | printf ( "Hello World" ); |
09 | return 0; |
10 | } |
hi prabhu, could u make 5th question clear.I dont get ur question
ReplyDeleteNow i posted questions properly...if still u have doubts ask me..
ReplyDeletenot 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++
ReplyDeleteA unique way is there for c or c++.But some statements are common in c and c++.
ReplyDelete