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 process of writing the null pointer?
what is computer
can we have joblib in a proc ?
Explain the array representation of a binary tree in C.
Can include files be nested? How many levels deep can include files be nested?
What does c mean?
write a program to insert an element at the specified position in the given array in c language
What functions are in conio h?
Difference between Class and Struct.
13 Answers Ericsson, Motorola, Wipro,
what are the languages used in c#?
what is void pointer?
write a program to convert a expression in polish notation (postfix) to inline (normal)