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

how to print
1 2 3 4 5 6 7 8 9 10 9 8 7 6 5 4 3 2 1
using any loop(for or while) only once(only 1 loop) and
maximum 2 variables using C.

Answer Posted / taizul

#include<iostream>
#include<cstdio>
using namespace std;

int main()
{
for(int i = 1; i < 20; i++){
if(i>=10){
printf("%d ",(10-(i%10)));

}
else{
printf("%d ",i);
}

}
return 0;
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to create a 3x3 two dimensional array that will give you the sums on the left and bottom columns

3707


How can you relate the function with the structure? Explain with an appropriate example.

3527


how to programme using switch statements and fuctions, a programme that will output two even numbers, two odd numbers and two prime numbers of the users chioce.

2738


Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange

3434


write a program for area of circumference of shapes

2631


why nlogn is the lower limit of any sort algorithm?

2902


What is the difference between proc means and proc tabulate ? explain with a simple example when you have to use means or tabulate?

4629


How to palindrom string in c language?

11366


write a function to give demostrate the functionality of 3d in 1d. function prototye: change(int value,int indexX,int indexY,int indexZ, int [] 1dArray); value=what is the date; indexX=x-asix indexY=y-axis indexZ=z-axis and 1dArray=in which and where the value is stored??

4753


What is data _null_? ,Explain with code when u need to use it in data step programming ?

3407


write a c program to input initial & final time in the format hh:mm and find the time intervel between them? Ex inputs are initial 06:30 final 00:05 and 23:22 final 22.30

2763


can you use proc sql to manpulate a data set or would u prefer to use proc report ? if so why ? make up an example and explain in detail

3113


Sir... please give some important coding questions asked by product companies..

2334


Develop a routine to reflect an object about an arbitrarily selected plane

3699


could you please send the program code for multiplying sparse matrix in c????

3631