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



write a C program, given number is double without using addt ion and multiplication operator?ex:n=6..

Answer / vadivelt

Do shift the given number left once.
ie., n<<1

Is This Answer Correct ?    8 Yes 1 No

write a C program, given number is double without using addt ion and multiplication operator?ex:n=6..

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

write a C program, given number is double without using addt ion and multiplication operator?ex:n=6..

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

write a C program, given number is double without using addt ion and multiplication operator?ex:n=6..

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

write a C program, given number is double without using addt ion and multiplication operator?ex:n=6..

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

write a C program, given number is double without using addt ion and multiplication operator?ex:n=6..

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

Post New Answer

More C Interview Questions

How can I open a file so that other programs can update it at the same time?

0 Answers  


How can type-insensitive macros be created?

0 Answers  


Explain enumerated types in c language?

0 Answers  


what is c++ programming?

3 Answers   TCS,


#define min((a),(b)) ((a)<(b))?(a):(b) main() { int i=0,a[20],*ptr; ptr=a; while(min(ptr++,&a[9])<&a[8]) i=i+1; printf("i=%d\n",i);}

3 Answers  






what is the use of ~ in c lang?????

3 Answers  


write a program structure to find average of given number

1 Answers  


What are operators in c?

0 Answers  


A stack can be implemented only using array?if not what is used?

3 Answers   InterGlobal,


different between overloading and overriding

3 Answers  


what is difference between array of characters and string

18 Answers   Accenture, Nest,


Here is alphabets : abcdefgh 1) how to reverse. as hgfedcba 2) after reversal, how to group them in a pair hg fe dc ba.

2 Answers  


Categories