the number 138 is called well ordered number because the
three digits in the number (1,3,8) increase from left to right
(1<3<8). the number 365 is not well ordered coz 6 is larger
than 5.
write a program that wull find and display all possible
three digit well ordered numbers.

sample:
123,124,125,126,127,128,129,134
,135,136,137,138,139,145,146,147
148
149,156.......789

Answer Posted / goloap

for (int i=1; i<8; i++)
for (int j=i; j<9; j++)
for (int k=j; k< 10; k++)
printf("%d\n", i*100+j*10+k);

Is This Answer Correct ?    6 Yes 18 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are pointers?

642


the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above

615


Write a program to check armstrong number in c?

644


How to create struct variables?

601


Which header file should you include if you are to develop a function which can accept variable number of arguments?

819






Define and explain about ! Operator?

621


Can a program have two main functions?

581


What is sizeof in c?

579


if a is an integer variable, a=5/2; will return a value a) 2.5 b) 3 c) 2 d) 0

1463


What are the main characteristics of c language describe the structure of ac program?

622


What are the standard predefined macros?

647


Why ca not I do something like this?

597


Why & is used in scanf in c?

635


simple program of graphics and their output display

1475


How do you use a 'Local Block'?

732