Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


program in c to print 1 to 100 without using loop

Answers were Sorted based on User's Feedback



program in c to print 1 to 100 without using loop..

Answer / gadigebhasker

void otoh(int,int);
void main()
{
int x,y;
printf("enter initial value x & y final value\n");
scanf("%d%d",&x,&y);
printf("0 to 100 number\n");
otoh(x,y);
getch();
}
void otoh(int a,int i)
{
if(a<=i)
{
printf("%d\t",a++);
otoh(a,i);
}
else
printf("END");
}

Is This Answer Correct ?    27 Yes 4 No

program in c to print 1 to 100 without using loop..

Answer / madhavi

main()
{
int i=1;
LOOP:
printf("%d\t",i);
i++;
if(i<=100)
goto LOOP;
}

Is This Answer Correct ?    6 Yes 0 No

program in c to print 1 to 100 without using loop..

Answer / rajasekhar

excellent thiking

Is This Answer Correct ?    5 Yes 1 No

program in c to print 1 to 100 without using loop..

Answer / nishikant kamble

#include<stdio.h>
int main()
{
int i=1;
suhas:
printf("%d\t",i);
i++;
if(i==101)
{
exit(1);
}
goto suhas;
}

Is This Answer Correct ?    2 Yes 0 No

program in c to print 1 to 100 without using loop..

Answer / darshana

Sub Main()
Dim i, j As Integer
Console.WriteLine("enter i numbers")
i = Console.ReadLine()

Console.WriteLine("enter j numbers")
j = Console.ReadLine()
Console.WriteLine()
new1(i, j)

End Sub

Sub new1(ByVal i As Integer, ByVal j As Integer)

Dim num As Integer = i

If num > j Then
Console.WriteLine("end")
Else


Console.WriteLine(num)
num = num + 1
new1(num, j)
End If



End Sub

Is This Answer Correct ?    0 Yes 0 No

program in c to print 1 to 100 without using loop..

Answer / praveen

#include<stdio.h>
#include<stdlib.h>
void prav(int);
main()
{
int i=1;
prav(i);
}

void prav(int j)
{
if(j<101)
{printf("%d\n",j);
j++;
prav(j);}

else
exit(0);


}

Is This Answer Correct ?    0 Yes 0 No

program in c to print 1 to 100 without using loop..

Answer / guest

using recursion

Is This Answer Correct ?    0 Yes 2 No

program in c to print 1 to 100 without using loop..

Answer / gadigebhasker

There are some corrections in the above program keep start label above first if statement and add goto start after the printf statement

Is This Answer Correct ?    0 Yes 4 No

program in c to print 1 to 100 without using loop..

Answer / ashu

#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int a;
clrscr();
printf("there are 1 to 100");
a=0;
if(a<100)
{
a++;
printf("%d\n",a);
}
else if(a>100)
{
goto end;
}
end: getch();
}

Is This Answer Correct ?    5 Yes 13 No

Post New Answer

More C Interview Questions

What is chain pointer in c?

0 Answers  


main() { char p[] = "hello world!"; p = "vector"; printf("%s",p); }

2 Answers   Vector, Vector India,


the number 138 is called well ordered number because the three digits in the number (1,3,8) increase from left to right (1<3<8). the number 365 is not well ordered coz 6 is larger than 5. write a program that wull find and display all possible three digit well ordered numbers. sample: 123,124,125,126,127,128,129,134 ,135,136,137,138,139,145,146,147 148 149,156.......789

5 Answers  


What are integer variable, floating-point variable and character variable?

0 Answers  


What are the features of the c language?

0 Answers  


Write a C program that defines a 2-dimentional integer array called A [50][50]. Then the elements of this array should randomly be initialized either to 1 or 0. The program should then print out all the elements in the diagonal (i.e. a[0][0], a[1][1],a[2][2], a[3][3], ……..a[49][49]). Finally, print out how many zeros and ones in the diagonal.

3 Answers   Infosys,


find the minimum of three values inputted by the user

3 Answers  


What is getch c?

0 Answers  


Explain how can I make sure that my program is the only one accessing a file?

0 Answers  


Explain what is a pragma?

0 Answers  


what is y value of the code if input x=10 y=5; if (x==10) else if(x==9) elae y=8; a.9 b.8 c.6 d.7

4 Answers   TCS,


How can my program discover the complete pathname to the executable from which it was invoked?

0 Answers  


Categories