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
List some of the dynamic data structures in C?
What is wrong with this declaration?
Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.
Why is structure important for a child?
What are the keywords in c?
What is the use of static variable in c?
Explain what is a const pointer?
What are register variables? What are the advantage of using register variables?
Are there any problems with performing mathematical operations on different variable types?
What is structure of c program?
Can we declare function inside main?
What is static memory allocation?
swap 2 numbers without using third variable?
How are portions of a program disabled in demo versions?
What is scanf () in c?