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 adt in c programming?
Is python a c language?
What are the advantages of the functions?
Explain what is a 'locale'?
What does main () mean in c?
What does c in a circle mean?
A c program to display count values from 0 to 100 and flash each digit for a secong.reset the counter after it reaches 100.use for loop,. pls guys hepl me.. :(
Can include files be nested?
illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question
write a c program for swapping two strings using pointer
What is your stream meaning?
4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.
How can I do graphics in c?
How is a structure member accessed?
Q.1 write aprogram to stack using linklist o insert 40 items? Q.2 write a program to implement circular queue with help of linklist?