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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Requesting for AMVI genaral studies syllabus

1577


when will the group1&group2 exams will be held

1376


difference between tcp ip and open system interconnection

2076


2. A product selected for testing is equally likely to have been produced by one the 6 machines/processes. (i) Determine sample space ā€˜Sā€™ (ii) What is the probability that the product is from machine 1? (iii) What is the probability that the product is from machine 2 or machine 4? (iv) What is the probability that the product is from both machine 5 and machine 3? (v) What is the probability that the product is not from machine 6? (vi) What is the probability that the product is not from either machine 6 or machine 1?

1523


how to delete four out of five duplicate records in a table using sql

1450






Write the fetch cycle and execute cycle for following instructions:JMPNZ (jump to the given address if the accumulator not equal to zero) RET(return from a subroutine) ADB (add the contents of register B to the accumulator and save result in the accumulator).

1776


If you were to drill a circular hole in a sheet of metal and then heat the sheet, what would happen to the size of the hole?

677


how much the percentile as a good percentile in elitmus.

6269


Write a test case plan for a typical banking application which involves functionalities like Balance enquiry, deposit, fund transfer etc. Make your assumptions and mention the same in your answer sheet.

1550


Paul the octopus who has been forecasting the outcome of FIFA world cup matches with tremendous accuracy has now been invited to predict ICC world cup matches in 2011. We will assume that the world cup contenders have been divided into 2 groups of 9 teams each. Each team in a group plays the other teams in the group. The top two teams from each group enter the semi finals ( after which the winner is decided by knockout). However, Paul has a soft spot for India and when India plays any team, Paul always backs India. Alas, his predictions on matches involving India are right only 2 out of 3 times. In order to qualify for the semi finals, it is sufficient for India to win 7 of its group matches. What is the probability that India will win the ICC world cup?

4124


sir i m reject two time in u.s in spring intake now im taking a date of 1july-2010 in fall intake &im competed my bachlor degree(chem) in jun-2009 so what answer i give to visa officer ask me a what r u doing last 1-year bcoz i have no work expirience

1352


sir,i am a 3rd yr student of computer engineering. i need atleast 10 previous year's placement papers of hcl,infosys & wipro. please send me these papers as early as possible.thanx for giving me your precious time.

1559


why one should join accenture?

2375


who is your favourate actor in tollywood tellme about him in few points

2601


Suppose that, even unrealistically, we are to search a list of 700 million items using Binary Search, Recursion (the algorithm given in class). What is the maximum number of comparisons that this algorithm must perform before finding a given item or concluding that it is not in the list?

3251