Program to find larger of the two numbers without using if-else,while,for,switch
Answer Posted / nidhish mathew
#include<stdio.h>
#include<math.h>
int main()
{
int i,j;
scanf("%d%d",&a,&b);
printf("Greater Number is %d",(a+b+abs(a-b))/2);
printf("Smallest Number is %d",(a+b-abs(a-b))/2);
}
| Is This Answer Correct ? | 16 Yes | 8 No |
Post New Answer View All Answers
Sir,please help me out with the code of this question. Write an interactive C program that will encode or decode multiple lines of text. Store the encoded text within a data file, so that it can be retrieved and decoded at any time. The program should include the following features: (a) Enter text from the keyboard, encode the text and store the encoded text in a data file. (b) Retrieve the encoded text and display it in its encoded form. (c) Retrieve the encoded text, decode it and then display the decoded text. (d) End the computation. Test the program using several lines of text of your choice.
How many types of operators are there in c?
What are c identifiers?
Why header file is used in c?
swap 2 numbers without using third variable?
What is union in c?
Why are all header files not declared in every c program?
Do you know the purpose of 'register' keyword?
What is the role of && operator in a program code?
What does c mean?
Explain how does flowchart help in writing a program?
What are the different types of C instructions?
what will be the output for the following main() { printf("hi" "hello"); }
What are enums in c?
What is the difference between declaring a variable by constant keyword and #define ing that variable?