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 |
Find the middle node in the linked list?? (Note:Do not use for loop, count and count/2)
What is identifiers in c with examples?
Ca some one please help me with aC code to allow user enter numbers from 1 to 20 without repeating and prnt the sum of those numbers thnx
what is the structure?
how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?
What is atoi and atof in c?
Write a program to find factorial of a number using recursive function.
Can you think of a way when a program crashed before reaching main? If yes how?
What is mean by data types in c?
What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
code for replace tabs with equivalent number of blanks
Why is sizeof () an operator and not a function?