write a C program, given number is double without using addt
ion and multiplication operator?ex:n=6,ans=12,pls send me ans
to goviseenu@gmail.com
Answers were Sorted based on User's Feedback
Answer / vadivelt
Do shift the given number left once.
ie., n<<1
| Is This Answer Correct ? | 8 Yes | 1 No |
Answer / manoj sharma
You can use left bitwise operator.
Say if your no is n then n<<1 will return n*2.
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / paramesh
#include<stdio.h>
#include<conio.h>
void main()
{
int a;
printf("Enter the number")
scanf("%d",&a);
printf("%d double number is %d", a,a<<1);
getch();
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / sandeep
#include<stdio.h>
#include<conio.h>
void main()
{
int num;
printf("Enter a floating point value");
scanf("%f",&num);
printf("Given no is %f and twice of number is %f"num,num-(-num));
getch();
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / venu
lol, you can't use bitwise operators on double. can be used
only for integers.
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / manish soni bca 3rd year jaipu
#include<stdio.h>
#include<conio.h>
void main()
{
int a;
printf("Enter number which you want to
double");
scanf("%d",&a);
printf("THE NUMBER IS %d AND DOUBLE NO IS %
d.",a,a<<1);
getch();//optional to write getch();
}
| Is This Answer Correct ? | 0 Yes | 1 No |
find the output of the following program main() { int x=5, *p; p=&x; printf("%d",++*p); }
Here is alphabets : abcdefgh 1) how to reverse. as hgfedcba 2) after reversal, how to group them in a pair hg fe dc ba.
How would you use the functions fseek(), freed(), fwrite() and ftell()?
0 Answers Aspire, Infogain, TISL,
What does return 1 means in c?
1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321
biggest of two no's with out using if condition statement
What is the difference between malloc calloc and realloc in c?
write a c program to find the sum of five entered numbers using an array named number
#define swap1(a,b) a=a+b;b=a-b;a=a-b; main() { int x=5,y=10; swap1(x,y); printf("%d %d\n",x,y); swap2(x,y); printf("%d %d\n",x,y); } int swap2(int a,int b) { int temp; temp=a; b=a; a=temp; return; } what are the outputs?
how to print electricity bill according to following charges first 100 units -1rs per unit for next 200 units-1.50 rs per unit without using conditions
Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.
write a recursive program in'c'to find whether a given five digit number is a palindrome or not