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 count no of words,characters,lines in a paragraph.
What is p in text message?
What is a null pointer in c?
all c language question
How can a number be converted to a string?
How do shell structures work?
Explain what is wrong in this statement?
What is the use of ?
Why is c fast?
How can I make sure that my program is the only one accessing a file?
Simplify the program segment if X = B then C ← true else C ← false
Is calloc better than malloc?
What are conditional operators in C?
Why c is a procedural language?
Explain that why C is procedural?