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 |
How can you determine the maximum value that a numeric variable can hold?
How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?
2 Answers Aricent, Manipal University,
what is void pointer?
What is Heap?
What is const and volatile in c?
What is a void * in c?
What is the purpose of macro in C language?
Write a code of a general series where the next element is the sum of last k terms.
Explain the difference between strcpy() and memcpy() function?
.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }
What is the advantage of c?
Explain how do you list files in a directory?