write a c program to find largest of three numbers using simple if only for one time.

Answer Posted / 1160

#include<stdio.h>
#include<conio.h>
int main()
{
int a,b,c,max;
scanf("%d %d %d",&a,&b,&c);
if (a>b && a>c)
{
printf("%d",a);
}
max=(b>c)&&(c>a)?printf("%d",b):printf("%d",c);
return max;
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is abstract data structure in c?

532


Write a program of advanced Fibonacci series.

709


Explain how many levels deep can include files be nested?

629


Explain what is meant by high-order and low-order bytes?

635


Why string is used in c?

582






How can this be legal c?

654


writ a program to compare using strcmp VIVA and viva with its output.

1525


What does 4d mean in c?

949


Tell us something about keyword 'auto'.

666


What are the different properties of variable number of arguments?

669


How can I trap or ignore keyboard interrupts like control-c?

620


Explain how do you view the path?

657


What are the types of pointers in c?

531


I need testPalindrome and removeSpace #include #define SIZE 256 /* function prototype */ /* test if the chars in the range of [left, right] of array is a palindrome */ int testPalindrome( char array[], int left, int right ); /* remove the space in the src array and copy it over to the "copy" array */ /* set the number of chars in the "copy" array to the location that cnt points t */ void removeSpace(char src[], char copy[], int *cnt); int main( void ) { char c; /* temporarily holds keyboard input */ char string[ SIZE ]; /* original string */ char copy[ SIZE ]; /* copy of string without spaces */ int count = 0; /* length of string */ int copyCount; /* length of copy */ printf( "Enter a sentence:\n" ); /* get sentence to test from user */ while ( ( c = getchar() ) != '\n' && count < SIZE ) { string[ count++ ] = c; } /* end while */ string[ count ] = '\0'; /* terminate string */ /* make a copy of string without spaces */ removeSpace(string, copy, ©Count); /* print whether or not the sentence is a palindrome */ if ( testPalindrome( copy, 0, copyCount - 1 ) ) { printf( "\"%s\" is a palindrome\n", string ); } /* end if */ else { printf( "\"%s\" is not a palindrome\n", string ); } /* end else */ return 0; /* indicate successful termination */ } /* end main */ void removeSpace(char src[], char copy[], int *cnt) { } int testPalindrome( char array[], int left, int right ) { }

2214


Tell us bitwise shift operators?

600