GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Programming  >  C
Go To First  |  Previous Question  |  Next Question 
 C  |  Question 433 of 453    Print  
A Program that does nothing
Write a program in C that does nothing not even takes memory?


  
Total Answers and Comments: 7 Last Update: September 11, 2009     Asked by: d.gupta03 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: shibinkidd
 

void main(void){
  while(1){
     ;
  }

}



Above answer was rated as good by the following members:
sivarama vinaykumar, dolly singh, rashmi.mohanty, vhps.18, Anshu007
August 04, 2008 07:44:51   #1  
shibinkidd Member Since: August 2008   Contribution: 1    

RE: A Program that does nothing

void main(void){
while(1){
;
}

}


 
Is this answer useful? Yes | NoAnswer is useful 2   Answer is not useful 1Overall Rating: +1    
August 25, 2008 10:48:13   #2  
Jaya_Kaja Member Since: July 2008   Contribution: 3    

RE: A Program that does nothing

Here is the program which does nothing without taking any Memory.


void main() { ; }




-Jayalakshmi Kaja


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
September 09, 2008 15:03:37   #3  
rashmi.mohanty Member Since: September 2008   Contribution: 8    

RE: A Program that does nothing
void main()
{ ; }

 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
September 23, 2008 03:10:57   #4  
sundar0306 Member Since: September 2008   Contribution: 1    

RE: A Program that does nothing
void main(); {;};end

 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
September 25, 2008 03:50:18   #5  
Gaurav Kumar Member Since: September 2008   Contribution: 2    

RE: A Program that does nothing
void main(){}
 
Is this answer useful? Yes | No
July 14, 2009 11:33:30   #6  
vinodkumar_garg Member Since: June 2009   Contribution: 3    

RE: A Program that does nothing
you can't design a program which doesn't take memory. even if you write

#include<stdio.h>
void main()
{
}

it will take some memory in stack for main functions. as main is a functions being called by startup code so when ever u call a function some information is stored in stack such as base pointer startup code address etc.

so no program is there which doesn t take memory.

 
Is this answer useful? Yes | No
September 11, 2009 04:35:59   #7  
mohit_verma Member Since: September 2009   Contribution: 2    

RE: A Program that does nothing
A program that does nothing is as:
void main(void)
{;}

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape