Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


when user give a number it multiply with 9 without
useing '+' and '*' oprator

Answers were Sorted based on User's Feedback



when user give a number it multiply with 9 without useing '+' and '*' oprator..

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

when user give a number it multiply with 9 without useing '+' and '*' oprator..

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

when user give a number it multiply with 9 without useing '+' and '*' oprator..

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

when user give a number it multiply with 9 without useing '+' and '*' oprator..

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

Post New Answer



More C Interview Questions

any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()

0 Answers  


How can I use a preprocessorif expression to ?

0 Answers  


What is the use of gets and puts?

0 Answers  


Difference between Shallow copy and Deep copy?

0 Answers  


A MobileNumber is a VIP number if it satisfy the following conditions. The operator should be Vodafone. Atleast one 0 (Zero) should be exist in mobile number. The number should not end with 8. The single digit sum of all the digits in the number should be equal to 9. For example if the number is 9876543210, the sum is 9+8+7+...+1+0 = 45. Sum of 4+5 = 9. Write a method: private boolean isVIPMobileNumber(String mobileNum, String operator) mobileNum phone number operator mobile operator as bsnl, Vodafone

1 Answers  






Write a program to swap two numbers without using third variable?

0 Answers  


If we give two names then this displays the connection between the two people. It is nothing but flames game

1 Answers  


Here is a neat trick for checking whether two strings are equal

0 Answers  


What is a sequential access file?

0 Answers  


Explain what are run-time errors?

0 Answers  


What is the difference between File pointer and Internal Charecter Pointer?

2 Answers   TATA,


code for quick sort?

0 Answers  






Categories