answersLogoWhite

0


Best Answer

To find greatest of 3 digits in one line

#includ<stdio.h> #include<conio.h>

void main() { int a,b,c; printf("enter a,b,c:); scanf("d%d%d",&a,&b,&c);

printf("greatest no: %d"(a>b)?((a>c)?a:c):((c>b)?c:b));

printf("have a nice day");

getch();

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

#include<stdio.h>

int main(){

int a,b,c;

int big;

printf("Enter any there numbers: ");

scanf("%d%d%d",&a,&b,&c);

if(a>b && a>c)

big = a;

else if(b>c)

big = b;

else

big = c;

printf("Largest number is: %d",big);

return 0;

}

Sample output:

Enter any there numbers: 13 25 6

Largest number is: 25

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program to find greatest of three number using conditional operator in c?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Program to find the greatest number?

The greatest number is infinity.


How do you find the greatest of three numbers using ternery operator?

Compare the first two numbers with the ternary operator. Store the result in a temporary variable. Compare the temporary variable with the third number, again using the ternary operator.


Adjoint operator of a complex number?

Adjoint operator of a complex number?


You want to write a simple without using pointer or array c program which will print greatest number when you give 20 number?

i want to write a simple without using pointer or array c program which will print greatest number when i give 20 number .........How far have you gotten so far?


when the biconditional statement is separated into a conditional and its converse, which of these cannot be the converse?

If a number is nonzero, then the number is positive.


How do you use the conditional statement of turbo c?

#include&lt;stdio.h&gt; void main() { int a=10,b=15; clrscr(); if(a&gt;b) printf("%d is the large number",a); else printf("%d is the large number",b); getch(); }


What is the operator number in the UK?

The main number for reaching a telephone operator in the UK is 100.


What number can you dial to get operator?

The number of a operator will be 0 or 411.


Program to print the greatest number in unix?

There is no such thing as 'the greatest number'. Here is a program in unix to prove it: echo 'for (i=1; i&gt;=0; i= i*2) print i,"\n";' | bc if you want to actually see the output use it this way: echo 'for (i=1; i&gt;=0; i= i*2) print i,"\n";' | bc | less -S


Is the following a conjunction disjunction conditional or biconditional A number is odd if and only if it is not even?

The statement is bi-conditional. The "if and only if" should have tipped you off immediately.


How many true conditional statements may be written using the following statements n is a rational number n is a integer n is a whole number?

Given that an integer is the same as a whole number, there are four true conditional statements.


The number one is the smallest positive square what is the conditional?

If the number is one, then it is the smallest positive square.