100,1,99,2,98,3...... write a C pgm to generate this series
with user input for the number of nos. to b displayed..
Answers were Sorted based on User's Feedback
Answer / soumya
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
clrscr();
for(i=100,j=1;i>0;i-=1,j+=1)
{
printf("%d,%d,",i,j);
}
getch();
}
| Is This Answer Correct ? | 16 Yes | 4 No |
Answer / vishwaranjan kumar singh
#include<stdio.h>
#include<conio.h>
void main()
{
int i=0,j=0;
getch();
for(i=100,j=1;i>0;i--,j++)
{
printf("%d-%d-",i,j);
}
clrscr();
}
| Is This Answer Correct ? | 14 Yes | 6 No |
Answer / niveditha
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,n,count=0;
printf("enter the number of no's to be displayed");
scanf("%d",&n);
for(i=100,j=1;count<n;i--,j++)
{
printf("%d,",i);
count=count+2;
if(count<=n)
printf("%d,",j);
}
getch();
}
| Is This Answer Correct ? | 7 Yes | 3 No |
Answer / suren
#include<stdio.h>
void main()
{
int i,j,n,count;
printf("Enter the number of numbers to be printed\n");
scanf("%d",&n);
for(i=100,j=1,count=0;count<n;i--,j++,count++)
{
printf(" %d ",i);
if(++count>=n)
return;
printf(" %d ",j);
}
}
| Is This Answer Correct ? | 4 Yes | 2 No |
Answer / gyanaranjan patra
#include<stdio.h>
void main()
{
static int a=100,i,b=1;
for (i=1;i<=100;i++)
{
printf("%d %d ",a,b);
a=a-1;
b=b+1;
}
}
// this is the simpler one try it;;;;.. ...
| Is This Answer Correct ? | 4 Yes | 2 No |
Answer / manohar bharti
#include<stdioh>
#include<conio.h>
void main()
{
int i,j,k,r;
printf("Enter the no. of terms you want");
scanf("%d",&r);
for(i=100,j=1,k=0;k<r;i--,j++,k++)
{
printf("%d",i);
k++;
printf(",");
if(k<r)
{
printf("%d",j);
printf(",");
}
else
return;
}
getch();
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / vishwaranjan singh
#include<stdio.h>
#include<conio.h>
void main()
{
int i=0,j=0;
getch();
for(i=100,j=1;i<0;i--,j++)
{
printf("%d-%d-",i,j);
}
clrscr();
}
| Is This Answer Correct ? | 4 Yes | 13 No |
a particle moving in a straight line with constant acceleration has a velocity of 8m/s at one instant and 3 seconds later it has a velocity of 2m/s.find its acceleration.
i am shortlisted in corporation bank for the post of computer officer the next phase is group discussion. i want to know how to prepare and what about the topics for preparing thanking you if you have any suggestion please give me prabhatmishra21@rediffmail.com
0 Answers Corporation Bank, State Bank Of India SBI,
Client server applications
friends help me..am a btech fresher.. wt is the eligibility criteria for TCS???? like %...repli me clearly from x onwards..
reverse a number ( like 1234 into 4321) using malloc in C programming
what are the differences between structures and arrays in c language?
why u r shifting from engineering to other field ?
Person who dicided to go to weekend trip should not exceed 8 hrs driving in a day. Average speed of forward journey is 40 miles/hour . Due to traffic in sundays ,in return journey average speed is 30mph . How far he can select a picnic spot ?
Can a generic class extend another generic class??
Please. Does someone know how to inicialize tapes in ATL? I need have 100 tapes to init inside the ATL, how is the process to complete this request?
for us visa interiew which file i have to carry(for example :folder file,gip file or other).please give me the answer .becoze the us consulate asks my documents, tommorow morning my interview so please grant me answer
give me a example of an application of Low severity & high priority.
Civil Engineering (5086)
Mechanical Engineering (4456)
Electrical Engineering (16639)
Electronics Communications (3918)
Chemical Engineering (1095)
Aeronautical Engineering (239)
Bio Engineering (96)
Metallurgy (361)
Industrial Engineering (259)
Instrumentation (3014)
Automobile Engineering (332)
Mechatronics Engineering (97)
Marine Engineering (124)
Power Plant Engineering (172)
Textile Engineering (575)
Production Engineering (25)
Satellite Systems Engineering (106)
Engineering AllOther (1379)