biggest of two no's with out using if condition statement
Answers were Sorted based on User's Feedback
Answer / abin m devasia,biju k m
#include<iostream.h>
void main()
{
int a,b,c;
cin>>a>>b;
c=abs(a-b);
c=(a+b+c)/2;
cout<<"Big is"<<c;
}
Is This Answer Correct ? | 18 Yes | 1 No |
Answer / abhilash.d
void main()
{
int a,b,big;
printf("enter the values of a,b");
scanf("%d%d",&a,&b);
big=a>b?a:b;
printf("biggest of two no is:%d",big);
}
Is This Answer Correct ? | 19 Yes | 7 No |
Answer / 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 |
Answer / jasna.c
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,big;
printf("\nEnter the two numbers ");
scanf("%d%d",&a,&b);
big=(a>b)?a:b;
printf("\n The biggest number is %d",big);
getch();
}
Is This Answer Correct ? | 4 Yes | 4 No |
Answer / 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 |
Answer / k.anand
#define myabs(a,b) a>b?(a-b):(b-a)
int main()
{
int a,b;
int biggest=0;
scanf("%d%d",&a,&b);
biggest=(a+b+myabs(a,b))/2;
printf("%d",biggest);
}
Is This Answer Correct ? | 6 Yes | 7 No |
Answer / agalya
#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=max(a,b);
m2=min(a,b);
printf("The Bigest No is==%d\n",m1);
printf("The Smallest No is==%d\n",m1);
}
Is This Answer Correct ? | 2 Yes | 3 No |
Answer / partheeban
void main()
{
float i,j;
int a;
printf("Enter two numbers : ");
scanf("%f%f",&i&j);
a=i/j;
if(a)
printf("%f is greater",i);
else
printf("%f is greater",j);
}
Is This Answer Correct ? | 2 Yes | 9 No |
int main() { unsigned char a = 0; do { printf("%d=%c\n",a,a); a++; }while(a!=0); return 0; } can anyone please explain me output????
What is a built-in function in C?
What is a C array and illustrate the how is it different from a list.
write a program that will open the file, count the number of occurences of each word in the the complete works of shakespeare. You will then tabulate this information in another file.
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
Explain the concept of "dangling pointers" in C.
How can a string be converted to a number?
Does * p ++ increment p or what it points to?
What is self-referential structure in c programming?
What is #line used for?
What is function prototype in c with example?
What is #ifdef ? What is its application?