biggest of two no's with out using if condition statement
Answer Posted / 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 |
Post New Answer View All Answers
What is output redirection?
How can I handle floating-point exceptions gracefully?
Why is not a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it is been freed?
The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration
Explain b+ tree?
How can I find the modification date and time of a file?
What is calloc malloc realloc in c?
An instruction which is analysed and acted upon by the processor prior to the compiler going its work a) directive b) constructive c) constant d) absolute mode
Explain what is the difference between functions abs() and fabs()?
What is the difference between if else and switchstatement
Why is it that not all header files are declared in every C program?
Explain the use of keyword 'register' with respect to variables.
Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].
How do you search data in a data file using random access method?
What are the 5 data types?