biggest of two no's with out using if condition statement
Answer Posted / saravanan marimuthuraja
#include <stdio.h>
#include <math.h>
void main()
{
int m1,m2,a,b;
clrscr();
printf("Enter the First Number\n");
scanf("%d",&a);
printf("Enter the Second Number\n");
scanf("%d",&b);
m1=abs((a+b)/2);
m2=abs((a-b)/2);
printf("The Bigest No is==%d\n",m1+m2);
printf("The Smallest No is==%d\n",m1-m2);
}
| Is This Answer Correct ? | 4 Yes | 4 No |
Post New Answer View All Answers
What is a global variable in c?
What are pointers? What are stacks and queues?
What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?
"C" language developed by "Dennis Ritchie" at AT & T. his remarks are a) too general, too abstract b) could deal with only specific problems c) lost generality of BCPL and B restored d) no remarks
Explain the advantages of using macro in c language?
7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.
Given a valid 24 hour format time find the combination of the value and write a program ,do not hard the value and if any other inputs provided should work with the logic implemented Input: 11:30 Output: 13:10 Input: 18:25 Output: 21:58
explain what is fifo?
Does free set pointer to null?
How was c created?
What does main () mean in c?
Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
What is the difference between exit() and _exit() function?
How many levels of pointers have?