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 |
In the below code, how do you modify the value 'a' and print in the function. You'll be allowed to add code only inside the called function. main() { int a=5; function(); // no parameters should be passed } function() { /* add code here to modify the value of and print here */ }
Tell me when would you use a pointer to a function?
Can we declare variable anywhere in c?
A woman had somany gloves and hats 22 red,34 blue, 45 white...there was power cut and she took a glove and how many gloves shud she take so that she gets a pair of glove fr each color??
PROGRAM TO WRITE CONTENTS OF 1 FILE IN REVERSE TO ANOTHER FILE,PROGRAM TO COPY 1 FILE TO ANOTHER BY SPECIFYING FILE NAMES AS COMMAND LINE
In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping
what is the output of the following code? main() { int I; I=0x10+010+10; printf("x=%x",I); } give detailed reason
What is the difference b/w Structure & Class?
What is modeling?
What is the difference between test design and test case design?
What is variable declaration and definition in c?
What is the difference between union and anonymous union?