ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
Write a C program to print 1 2 3 ... 100 without using 
loops?
 Question Submitted By :: Vjeeva11
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Write a C program to print 1 2 3 ... 100 without using loops?
Answer
# 1
int i;
void main(void)
{
 	if(i<=100)
   	printf("%d\n", i);
   i++;
   main();
   getch();
}
 
Is This Answer Correct ?    4 Yes 2 No
Neha
 
  Re: Write a C program to print 1 2 3 ... 100 without using loops?
Answer
# 2
void main ()
{
  static int i;
  if (i <= 100)
  {
    printf ("%d\n", i);
    i++;
    main ();
  }
}
 
Is This Answer Correct ?    7 Yes 0 No
Sutanu
 
 
 
  Re: Write a C program to print 1 2 3 ... 100 without using loops?
Answer
# 3
void main()
{
    int i=1;
    e:
    printf("%d\t",i);
    i++;
    if(i<=100)
       goto e;
}
 
Is This Answer Correct ?    4 Yes 0 No
Gunabalan
 
  Re: Write a C program to print 1 2 3 ... 100 without using loops?
Answer
# 4
void printer(int num)
{
   if(n==0)
     return;
   printer(--n);
    printf("%d ",n);
}
 
Is This Answer Correct ?    1 Yes 0 No
Olga
 
  Re: Write a C program to print 1 2 3 ... 100 without using loops?
Answer
# 5
void main(int n)
{
   if(n==0)
     return;
   main(--n);
    printf("%d ",n);
getch();
}
 
Is This Answer Correct ?    0 Yes 0 No
Professor Uday Kumar Bhupathi
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
Find string palindrome 10marks Honeywell5
Is the C language is the portable language...If yes...Then Why...and if not then what is problem so it is not a Portable language..??? TCS1
write the function int countchtr(char string[],int ch);which returns the number of timesthe character ch appears in the string. for example the call countchtr("she lives in Newyork",'e') would return 3.  4
how to make c program without a libary? e.g.#include<stdio.h> libary is not in c progaram.  1
difference between memcpy and strcpy  1
wap to print "hello world" without using the main function. TCS16
Determine if a number is a power of 2 at O(1).  1
to find out the reverse digit of a given number Infosys5
Write a program in c to input a 5 digit number and print it in words.  1
Design a program using an array that searches a number if it is found on the list of the given input numbers and locate its exact location in the list.  3
Give a method to count the number of ones in a 32 bit number?  1
what will be the output: main(){char ch;int a=10;printf("%d",ch);} Wipro29
what is the use of call back function in c?tell me with example  1
main() { int arr[5]={23,67}; printf("%d%d%d",arr[2],arr[3],arr[4]); } TCS6
Reverse a string word by word??  6
main() {int a=200*200/100; printf("%d",a); } TCS7
5. distance conversion: Convert a distance from miles to kilometers .there are 5280 feets per mile,12 inches per foot .2.54 centimeters per inch and 100000centimeters per kilometer  1
how to find the kth smallest element in the given list of array elemnts. Silicon5
dibakar & vekatesh..uttejana here..abt ur reply for in place reversal of linked list..wats p stands for there?  1
#include<stdio.h> main() { char *p1; char *p2; p1=(char *) malloc(25); p2=(char *) malloc(25); strcpy(p1,"Ramco"); strcpy(p2,"Systems"); strcat(p1,p2); printf("%s",p1); } Tell me the output? Ramco5
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com