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 / karthick_int
#include<stdio.h>
void main()
{
int n,i,j,k,m;
clrscr();
printf("Entr d no:");
scanf("%d",&n);
i=n%10;j=n/10;
k=j%10;m=j/10;
printf("The values are:%d\t%d\t%d\t",i,k,m);
if((i>k)&&(i>m))
{
if(k>m)
{
printf("Well ordered");
}
}
else
{
printf("not");
}
getch();
}
| Is This Answer Correct ? | 7 Yes | 6 No |
Post New Answer View All Answers
How can you increase the size of a statically allocated array?
The statement, int(*x[]) () what does in indicate?
What is the difference between the = symbol and == symbol?
What is the use of ?
What is the easiest sorting method to use?
Why use int main instead of void main?
What are the application of c?
What is wrong with this initialization?
What do you know about the use of bit field?
How does selection sort work in c?
Is struct oop?
How will you write a code for accessing the length of an array without assigning it to another variable?
Does free set pointer to null?
What does != Mean in c?
What is ponter?