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



100,1,99,2,98,3...... write a C pgm to generate this series with user input for the number of nos...

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

100,1,99,2,98,3...... write a C pgm to generate this series with user input for the number of nos...

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

100,1,99,2,98,3...... write a C pgm to generate this series with user input for the number of nos...

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

100,1,99,2,98,3...... write a C pgm to generate this series with user input for the number of nos...

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

100,1,99,2,98,3...... write a C pgm to generate this series with user input for the number of nos...

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

100,1,99,2,98,3...... write a C pgm to generate this series with user input for the number of nos...

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

100,1,99,2,98,3...... write a C pgm to generate this series with user input for the number of nos...

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

Post New Answer

More Engineering AllOther Interview Questions

The factorial of a nonnegative integer n is written n! (pronounced “n factorial”) and is defined as follows: n! = n · (n - 1) · (n - 2) · … · 1 (for values of n greater than to 1) and n! = 1 (for n = 0 or n = 1). For example, 5! = 5 · 4 · 3 · 2 · 1, which is 120. Use while structures in each of the following: a) Write a program that reads a nonnegative integer and computes and prints its factorial. Use the following function prototype to calculate factorial: int myFactorial(int n); b) Write a program that estimates the value of the mathematical constant e by using the formula: Use the following function prototype to calculate e: double myE( ); Hint: Use an accuracy of 10 terms. c) Write a program that computes the value of ex by using the formula Use the following function prototype to calculate e: double myEx(int x);

2 Answers  


to print greatest of two integers without using >,<,=.

0 Answers  


What are the fundamental differences between Engineering and Physics?

0 Answers  


How would you design a gravity dam for holding back water?

0 Answers  


/bin/bash is missing.

0 Answers  






write a program to accept 2 numbers from user calculate sum of each digit,reverse the orignal number and display

2 Answers  


basic difference between run time and compile time polymorphism

3 Answers  


sir, i am khalidh iam preparing for the examinations of Hpcl information systems officers for that iam having a guidence for the written exam.So provide me a test apptitude papers and subject related questions.

0 Answers  


real time examples for basic concepts in oop

0 Answers   Wipro,


Full form of Abt Meter

2 Answers   ABB,


how convert the spiral model to prototype model ?

0 Answers  


what are the steps u follow to create an custom idoc program in which environment u create the program?

0 Answers   HCL,


Categories
  • Civil Engineering Interview Questions Civil Engineering (5085)
  • Mechanical Engineering Interview Questions Mechanical Engineering (4451)
  • Electrical Engineering Interview Questions Electrical Engineering (16632)
  • Electronics Communications Interview Questions Electronics Communications (3918)
  • Chemical Engineering Interview Questions Chemical Engineering (1095)
  • Aeronautical Engineering Interview Questions Aeronautical Engineering (239)
  • Bio Engineering Interview Questions Bio Engineering (96)
  • Metallurgy Interview Questions Metallurgy (361)
  • Industrial Engineering Interview Questions Industrial Engineering (259)
  • Instrumentation Interview Questions Instrumentation (3014)
  • Automobile Engineering Interview Questions Automobile Engineering (332)
  • Mechatronics Engineering Interview Questions Mechatronics Engineering (97)
  • Marine Engineering Interview Questions Marine Engineering (124)
  • Power Plant Engineering Interview Questions Power Plant Engineering (172)
  • Textile Engineering Interview Questions Textile Engineering (575)
  • Production Engineering Interview Questions Production Engineering (25)
  • Satellite Systems Engineering Interview Questions Satellite Systems Engineering (106)
  • Engineering AllOther Interview Questions Engineering AllOther (1379)