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
What is the use of typedef in c?
What are the advantages of using Unions?
What does void main () mean?
What is difference between union All statement and Union?
What is the acronym for ansi?
what are # pragma staments?
What is pointers in c with example?
what is the diffrenet bettwen HTTP and internet protocol
Why dont c comments nest?
Are comments included during the compilation stage and placed in the EXE file as well?
What are the types of i/o functions?
Explain what are its uses in c programming?
How can you access memory located at a certain address?
Explain how can you be sure that a program follows the ansi c standard?
Should a function contain a return statement if it does not return a value?