write a program that accepts 3 numbers from the user. dispaly
the values in a descending order.
Answers were Sorted based on User's Feedback
Answer / nitin garg
#include <stdio.h>
#include <conio.h>
#include <string.h>
int main()
{
int a,b,c;
printf("Enter Three Number
");
scanf("%d%d%d",&a,&b,&c);
if(a>b && a>c)
{
if(b>c)
printf("%d %d %d",c,b,a);
else
printf("%d %d %d",b,c,a);
}
if(b>a && b>c)
{
if(a>c)
printf("%d %d %d",c,a,b);
else
printf("%d %d %d",a,c,b);
}
if(c>a && c>b)
{
if(b>a)
printf("%d %d %d",a,b,c);
else
printf("%d %d %d",b,a,c);
}
getch();
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / anupama shelke
#include<stdio.h>
#include<conio.h>
main()
{
int a[3],i,j,temp;
clrscr();
for(i=0;i<3;i++)
{
printf("\nEnter the values:");
scanf("%d",&a[i]);
}
for(i=0;i<3;i++)
{
for (j=i+1;j<3;j++)
{
if(a[i]<b[i])
{
temp=a[i];
a[i]=b[i];
b[i]=temp;
}
}
}
for(i=0;i<3;i++)
{
printf("array is:%d",a[i])
}
getch();
return;
}
| Is This Answer Correct ? | 3 Yes | 5 No |
include<stdio.h>
int main()
{
int a,b,c;
printf("enter the a value")
| Is This Answer Correct ? | 2 Yes | 5 No |
which type of question asked from c / c++ in interview.
WAP to convert text into its ASCII Code and also write a function to decode the text given?
Is c still used?
What is the exact difference between '\0' and ""
What is the condition that is applied with ?: Operator?
In which mode we open the file for read,write and append also in c ? a)W b)w+ c)r+ d)a
what will be the output of this program........ main() { int a=2,b=4,c=6; printf("%d"); } why it gives the value of third variable.
What are the properties of union in c?
write a program that prints a pascal triangle based on the user input(like how many stages) in an efficient time and optimized code?
What is static volatile in c?
Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10
What is pre-emptive data structure and explain it with example?