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
What is the best style for code layout in c?
explain what are actual arguments?
pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)
How do you generate random numbers in C?
What are run-time errors?
What is a structural principle?
How can I check whether a file exists? I want to warn the user if a requested input file is missing.
What is getch?
What is #include stdlib h?
How can you be sure that a program follows the ANSI C standard?
How macro execution is faster than function ?
I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.
the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters
What are keywords c?
Hello. How to write a C program to check and display president party like if i type in the console "biden" and hit enter the output shoud be : "biden is democrat" and if i type "trump" and hit enter the output shoud be: "trump is republican"