biggest of two no's with out using if condition statement
Answers were Sorted based on User's Feedback
Answer / sarvanm
#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 ? | 15 Yes | 1 No |
Answer / deepshree sinha
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,m;
printf('enter any two numbers");
scanf("%d %d",&a,&b);
m=(a>b)?a:b;
printf("m=%d",m);
getch();
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / ramanjaneyareddy
#include<stdio.h>
main()
{int a,b,c;
scanf("%d%d",&a,&b);
c=(a>b)?a:b;
printf("%d",c);
return(0);
}
| Is This Answer Correct ? | 2 Yes | 3 No |
Answer / shafi.shaik
main()
{
int a,b;
a=10;
b=20;
clrscr();
if(a/b)
printf("A is Biggest");
if(b/a)
printf("B is Biggest");
getch();
}
| Is This Answer Correct ? | 0 Yes | 2 No |
What is a structure member in c?
Write a program to add the following ¼+2/4+3/4+5/3+6/3+... (Like up to any 12 no.s)
int arr[] = {1,2,3,4} int *ptr=arr; *(arr+3) = *++ptr + *ptr++; Final contents of arr[]
#include<stdio.h> { printf("Hello"); } how compile time affects when we add additional header file <conio.h>.
I have one doubt. What does below statement mean? #define sizeof(operator) where operator can be int or float etc. Does this statement meaningful and where it can be used?
What is the acronym for ansi?
main() { int age; float ht; printf("Enter height and age"); scanf("%d%d",&height,&age); if((age<=20)&&(ht>=5)) {printf("She loves you");} else {printf("She loves you");} }
Explain high-order and low-order bytes.
Write a program to enter the name and age. If age>28 then find salary categories. if age<28 then find that you are gaduate or not.
Subtract Two Number Without Using Subtraction Operator
How can I convert a number to a string?
What is the purpose of 'register' keyword in c language?