when user give a number it multiply with 9 without
useing '+' and '*' oprator
Answer Posted / vaibhav nigam
/*
your answer is quite correct but its better to use
r=-r; instead of r=abs(r);
well i would have done it like :
*/
#include <iostream>
using namespace std;
int main()
{
int k;
cin >> k;
k=(k<<4)-(k<<2)-(k<<1)-k;
cout << k << endl;
return 0;
}
//here no loop is used..
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
How to write a code for reverse of string without using string functions?
Can you return null in c?
Is there a way to compare two structure variables?
string reverse using recursion
what is the height of tree if leaf node is at level 3. please explain
illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question
How #define works?
Explain the use of #pragma exit?
Explain how do I determine whether a character is numeric, alphabetic, and so on?
Why & is used in c?
how to find binary of number?
Explain what is the advantage of a random access file?
What does typedef struct mean?
What is use of pointer?
What is the purpose of sprintf?