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 |
Is sizeof a keyword in c?
What are header files and what are its uses in C programming?
c program to manipulate x=1!+2!+3!+...+n! using recursion
What is sizeof array in c?
What is the difference function call by value & function call by reference?
will the program compile? int i; scanf(ā%dā,i); printf(ā%dā,i);
what is data structure
Write a program to produce the following output in c language? 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1
Once I have used freopen, how can I get the original stdout (or stdin) back?
Why ca not I do something like this?
What is wrong with this code such that it doesnt produce the input reversed? #include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { char Space = ' '; char LineOfText; float count; LineOfText = getchar(); while ((LineOfText = getchar()) != '/n'); { count = strlen(LineOfText) - 1; while (count >= 0) { putchar(LineOfText[count]); count--; } } getchar(); return 0; }
What does %f mean c?