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 ? | 9 Yes | 2 No |
Post New Answer View All Answers
What is a sequential access file?
How to write c functions that modify head pointer of a linked list?
State the difference between realloc and free.
What is the scope of global variable in c?
Write a code to generate divisors of an integer?
difference between Low, Middle, High Level languages in c ?
Is there any data type in c with variable size?
How many bytes are occupied by near, far and huge pointers (dos)?
A banker has a seif with a cipher. Not to forget the cipher, he wants to write it coded as following: each digit to be replaced with the difference of 9 with the current digit. The banker chose a cipher. Decipher it knowing the cipher starts with a digit different than 9. I need to write a program that takes the cipher from the keyboard and prints the new cipher. I thought of the following: Take the input from the keyboard and put it into a string or an array. Go through the object with a for and for each digit other than the first, substract it from 9 and add it to another variable. Print the new variable. Theoretically I thought of it but I don't know much C. Could you give me any kind of hint, whether I am on the right track or not?
Explain can you assign a different address to an array tag?
What are the 4 types of programming language?
What are the benefits of c language?
Describe dynamic data structure in c programming language?
Why is structure important for a child?
Are the variables argc and argv are always local to main?