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
diff between exptected result and requirement?
how is the examination pattern?
What are the different types of endless loops?
Can we declare variable anywhere in c?
What is a program?
What does dm mean sexually?
Why c is procedure oriented?
write a program to print largest number of each row of a 2D array
How do you convert strings to numbers in C?
What is function in c with example?
The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?
If I have a char * variable pointing to the name of a function ..
Explain how can you tell whether two strings are the same?
How many types of operator or there in c?
What does %p mean?