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 |
a value that does not change during program execution a) variabe b) argument c) parameter d) none
Table of Sudoku n*n
what are the program that using a two dimensional array that list the odd numbers and even numbers separately in a given 10 inputs values
0 Answers College School Exams Tests,
Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].
Write a C program to count the number of email on text
What is the best way to comment out a section of code that contains comments?
write a program that print itself even if the source file is deleted?
How is null defined in c?
a character variable can at a time store a) 1 character b) 8 characters c) 254 characters d) none of the above
i want to have a program to read a string and print the frequency of each character and it should work in turbo c
how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.
how to find anagram without using string functions using only loops in c programming