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

#include<stdio.h>
int main(){
int i,j,k;
for (i=1; i<8; i++)
for (j=i+1; j<9; j++)
for (k=j+1; k< 10; k++)
printf("%d\n", i*100+j*10+k);
}

Is This Answer Correct ?    19 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is a const pointer?

630


Tell me can the size of an array be declared at runtime?

589


How can I recover the file name given an open stream?

545


What is scope rule in c?

595


What is the time and space complexities of merge sort and when is it preferred over quick sort?

665






Can you subtract pointers from each other? Why would you?

550


If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?

770


Is it better to use a macro or a function?

644


What is call by reference in functions?

551


Give differences between - new and malloc() , delete and free() ?

601


how can I convert a string to a number?

590


Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.

1757


What is a void pointer? When is a void pointer used?

614


How many keywords (reserve words) are in c?

603


When should a type cast be used?

571