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

What is the use of typedef in c?

563


What are the advantages of using Unions?

625


What does void main () mean?

698


What is difference between union All statement and Union?

606


What is the acronym for ansi?

600






what are # pragma staments?

1601


What is pointers in c with example?

550


what is the diffrenet bettwen HTTP and internet protocol

1364


Why dont c comments nest?

596


Are comments included during the compilation stage and placed in the EXE file as well?

644


What are the types of i/o functions?

651


Explain what are its uses in c programming?

573


How can you access memory located at a certain address?

641


Explain how can you be sure that a program follows the ansi c standard?

830


Should a function contain a return statement if it does not return a value?

566