when user give a number it multiply with 9 without
useing '+' and '*' oprator
Answers were Sorted based on User's Feedback
Answer / guest
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{clrscr();
int a,i,r=0;
scanf("%d",&a);
for(i=a;i>0;i--)
r=r-9;
r=abs(r);
printf("%d",r);
getch();
}
Is This Answer Correct ? | 4 Yes | 2 No |
Answer / tknowledge05
The above guest is me .. okk....
by the time i solved and executing i was logged out and when i posted the answer it considered guest.......
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / tknowledge05
The above guest is me .. okkkk....
by the time i solved and executing i was logged out and when i posted the answer it considered guestt.........
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / 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 |
What is the real time usage volatile?
When we use void main and int main?
Why is C language being considered a middle level language?
How can you convert integers to binary or hexadecimal?
why the execution starts from main function
Write a program that will read the input of any number of digits n in a row of shafh showing the breakdown of the printing and printing figures by the recursive function.
cavium networks written test pattern ..
which is an algorithm for sorting in a growing Lexicographic order
What are enumerated types?
exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above
What does c in a circle mean?
What is putchar() function?