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


Please Help Members By Posting Answers For Below Questions

diff between exptected result and requirement?

1824


how is the examination pattern?

1814


What are the different types of endless loops?

856


Can we declare variable anywhere in c?

748


What is a program?

942


What does dm mean sexually?

1065


Why c is procedure oriented?

809


write a program to print largest number of each row of a 2D array

2114


How do you convert strings to numbers in C?

953


What is function in c with example?

856


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?

925


If I have a char * variable pointing to the name of a function ..

931


Explain how can you tell whether two strings are the same?

829


How many types of operator or there in c?

854


What does %p mean?

843