Find the largest number from the given 2 numbers without using
any loops and the conditional operator.
Answers were Sorted based on User's Feedback
Answer / surya
if(!(a/b)) // if a is less than b then division result will be zero.
02
{
03
cout << " b is greater than a";
04
}
05
else if (!(a-b)) // we know a is greater than or equal to b now. check whether they are equal.
06
{
07
cout << "a and b are equal";
08
}
09
else
10
cout << "a is greater than b";
| Is This Answer Correct ? | 9 Yes | 6 No |
Answer / anji
We can compare two
values using unary
operators also
| Is This Answer Correct ? | 0 Yes | 0 No |
how 2 compile & execute c program with out using editor?
How reliable are floating-point comparisons?
What standard functions are available to manipulate strings?
How can a program be made to print the name of a source file where an error occurs?
Define a structure to store roll no, name and marks of a student. Using the structure of above write a ‘C’ program to create a file “student.dat”. There must be one record for every student in the file. Accept the data from the user.
How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?
1)what is the error in the following stmt where str is a char array and the stmt is supposed to traverse through the whole character string str? for(i=0;str[i];i++) a)There is no error. b)There shud be no ; after the stmt. c)The cond shud be str[i]!='\0' d)The cond shud be str[i]!=NULL e)i shud be initialized to 1
Why do we need volatile in c?
#include <stdio.h> int main() { int i; for (i=0;i<3;++i) { fork();fork(); } } How many processes are created when running this program (including the initial one)? Explain ؟؟؟
What is string concatenation in c?
Explain what are the standard predefined macros?
simple c program for 12345 convert 54321 with out using string