Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Write a c program to demonstrate character and string constants?

2128


What is meant by type casting?

1029


What is the use of c language in real life?

984


How does #define work?

1026


Why do we need a structure?

989


Does * p ++ increment p or what it points to?

1069


How can I swap two values without using a temporary?

1067


What is exit() function?

974


Explain what are global variables and explain how do you declare them?

1095


What is a ternary operator in c?

1064


What is the purpose of type declarations?

1084


What is the difference between Printf(..) and sprint(...) ?

1443


What are categories used for in c?

1045


Differentiate between ordinary variable and pointer in c.

1111


string reverse using recursion

2390