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 |
char ch="{'H','I',0};printf("%s",ch);what is output
What will be the outcome of the following conditional statement if the value of variable s is 10?
What is alloca() and why is its use discouraged?
FIND THE OUTPUT IF THE INPUT IS 5 5.75 void main() { int i=1; float f=2.25; scanf("%d%f",&i,&f); printf("%d %f",,i,f); } ANSWER IS 5 AND 2.25 WHY?
Write a C program in Fibonacci series.
What are the string functions? List some string functions available in c.
How can I remove the leading spaces from a string?
What is s in c?
nic scientist exam
Write a program to show the change in position of a cursor using c
The difference between printf and fprintf is ?
Difference between constant pointer and pointer to a constant.