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

Answers were Sorted based on User's Feedback



the number 138 is called well ordered number because the three digits in the number (1,3,8) increas..

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

the number 138 is called well ordered number because the three digits in the number (1,3,8) increas..

Answer / ankit kamboj

#include<stdio.h>
main()
{
int i,j,n,a,n1,cnt=0;;

int arr[3];
for(n=100;n<=999;n++)
{ n1=n;
for(i=2;i>=0,n1>0;i--,n1=n1/10)
{ a=n1%10;
arr[i]=a;
}

for(i=0;i<3;i++)
printf("%d ",arr[i]);

if(arr[0]<arr[1] && arr[1]<arr[2])
{printf("It is well ordered \n"); cnt++;}
else
printf("It is not well order\n");

}
printf("The n0. of well ordered no. are %d\n",cnt);
}

Is This Answer Correct ?    6 Yes 2 No

the number 138 is called well ordered number because the three digits in the number (1,3,8) increas..

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

the number 138 is called well ordered number because the three digits in the number (1,3,8) increas..

Answer / santosh kumar

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

Is This Answer Correct ?    7 Yes 15 No

the number 138 is called well ordered number because the three digits in the number (1,3,8) increas..

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

More C Interview Questions

which is the best antivirus and how to update it

7 Answers   Infosys,


ATM machine and railway reservation class/object diagram

0 Answers   Zycus Infotech,


second highest number in a given set of numbers

3 Answers   TCS,


Can you return null in c?

0 Answers  


How are portions of a program disabled in demo versions?

0 Answers  






2. Write a function called hms_to_secs() that takes three int values&#8212;for hours, minutes, and seconds&#8212;as arguments, and returns the equivalent time in seconds.. Create a program that exercises this function by repeatedly obtaining a time value in hours, minutes, and seconds from the user (format 12:59:59), calling the function, and displaying the value of seconds it returns.

5 Answers   TCS,


Can we initialize extern variable in c?

0 Answers  


How do I determine whether a character is numeric, alphabetic, and so on?

0 Answers  


what is the meaning of 'c' language

3 Answers  


Is struct oop?

0 Answers  


Write a program to generate random numbers in c?

0 Answers  


Symmetric technologies interview questions. For Computer science candidates the first round is a objective type written test consisting of 16 questions.It is very easy ,any police man can solve this. And next round is a written test consists of both objective and subjective .Total 40 question related to c,c++ and operating system related questions. And then a technical interview and give some program to solve with computer.The md is adamant person, whatever he says we have to accept that is the condition. And one more thing ,,,these interview is just for a formality..the company will select only innocent guys.. the person's without a backbone only they require.. And u have to submit the certificates this is the most important problem...So if you are not getting any other jobs..then only join with this... It is better to try for other company...And apart from that symmetric do a lot of projects..If a candidate can manage everything u can join and make good career with this company... The Md will normally speak rudely..but he is good person and he will give you a lot of very good chances to improve your career....but with cheap salary....

0 Answers   Symmetric Technologies,


Categories