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 introdu5ce my self in serco
How will you declare an array of three function pointers where each function receives two ints and returns a float?
What are the salient features of c languages?
typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?
Why is c not oop?
What does double pointer mean in c?
How would you use the functions fseek(), freed(), fwrite() and ftell()?
What is structure padding and packing in c?
Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)
what is reason of your company position's in india no. 1.
What are all different types of pointers in c?
Stimulate calculator using Switch-case-default statement for two numbers
what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above
Should I learn data structures in c or python?
What is difference between constant pointer and constant variable?