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


Please Help Members By Posting Answers For Below Questions

What does c in a circle mean?

579


State two uses of pointers in C?

636


How do we declare variables in c?

561


Is the exit() function same as the return statement? Explain.

656


the question is that what you have been doing all these periods (one year gap)

1614






What are header files and what are its uses in C programming?

625


What does %d do in c?

539


What is storage class?

654


Can stdout be forced to print somewhere other than the screen?

620


‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.

1876


Is c is a high level language?

618


The purpose of this exercise is to benchmark file writing and reading speed. This exercise is divided into two parts. a). Write a file character by character such that the total file size becomes approximately >10K. After writing close the file handler, open a new stream and read the file character by character. Record both times. Execute this exercise at least 4 times b). Create a buffer capable of storing 100 characters. Now after generating the characters, first store them in the buffer. Once the buffer is filled up, store all the elements in the file. Repeat the process until the total file size becomes approximately >10K.While reading read a while line, store it in buffer and once buffer gets filled up, display the whole buffer. Repeat the exercise at least 4 times with different size of buffer (50, 100, 150 …). Records the times. c). Do an analysis of the differences in times and submit it in class.

1626


c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above

608


What is the usage of the pointer in c?

604


What are header files in c?

614