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..

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

WHY WE USE {} AT THE STARTING OF C PROGRAM

1502


how to handle errors in fastload?

1660


am a textile eng. frombut with major of my course including chemical eng, subjects, can i too apply to the co.?

1522


Write a nonrecursive routine to reverse a singly linked list in O(N) time.

3108


What are the frequently asked technical engineer ques?

1413






if we give you the job AS A PETROLEUM ENGINEER WHAT WILL YOU DO(that is extraordinary) for our company

2863


WHAT IS DIFFERENCE BETWEEN ART & VECTOR QUANTISATION BASED ON THEIR APPLICATION IN NEURAL NETWORK

1324


Prepare the UGC CSIR net question papers those are enough. The question paper will be of 50 questions in size each 3 marks and with a negative of -1 for each wrong answer

2505


Hi friends..cud any help to get QC 9.2 trial..i tried with HP site but did'nt got it..please help me out

1666


what is total power generation capacity in india at present (as on 12-12-2011)

1653


How to control the Relative humidity in Air handling unit in Pharmaceutical company ,the AHU is comprised with DX system(Cooling coil) and dry heaters. We are facing the RH issue low side and higher side.

904


hi to all,i done ccna,now im looking job,but it is very diffcult to get job in networking field,.........i dnt know what im doing wrongly,kindly help me and give the proper way...i have so much of interest in this field only

1492


How many VLANs are supported on a single switch

1378


describe about storage allocation and scope of global,exterm,static,local and register variables in c language?

1814


what are basic step involved in embedded system software development?

2588