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
Why doesn't C support function overloading?
PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM
What is pivot in c?
write a c program to calculate sum of digits till it reduces to a single digit using recursion
What is a pointer and how it is initialized?
A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none
What is 1d array in c?
Do you know what are bitwise shift operators in c programming?
Explain logical errors? Compare with syntax errors.
What is the ANSI C Standard?
int i=10; printf("%d %d %d", i, i=20, i);
How can I find the modification date of a file?
Why main is used in c?
What is the difference between far and near in c?
Is a pointer a kind of array?