GeekInterview.com
Series: Subject: Topic:
Question: 9 of 238

printing a statement without using semi colon

How to swap two numbers without using temporary variable?
Asked by: rabia.sultana14 | Member Since Mar-2011 | Asked on: May 28th, 2011

View all questions by rabia.sultana14

Showing Answers 1 - 2 of 2 Answers
vinaysubramanian

Answered On : Jul 17th, 2011

Code
  1. #include<stdio.h>
  2. #include<conio.h>
  3. void main()
  4. {
  5.    int a=2,b=3;
  6.    a=a+b;
  7.    b=a-b;
  8.    a=a-b;
  9.    printf("%d %d ",&a,&b);
  10. }  

  
Login to rate this answer.
Shiva

Answered On : Sep 27th, 2011

place the statement you want to print in the if block

Code
  1. void main()
  2. {
  3. if((printf("hai shiva shankar"))
  4. {
  5. }
  6. }
  7.  

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.