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
Explain what is a const pointer?
Tell me can the size of an array be declared at runtime?
How can I recover the file name given an open stream?
What is scope rule in c?
What is the time and space complexities of merge sort and when is it preferred over quick sort?
Can you subtract pointers from each other? Why would you?
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?
Is it better to use a macro or a function?
What is call by reference in functions?
Give differences between - new and malloc() , delete and free() ?
how can I convert a string to a number?
Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.
What is a void pointer? When is a void pointer used?
How many keywords (reserve words) are in c?
When should a type cast be used?