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

.find the output of the following program? char*myfunc(char*ptr) { ptr +=3; return (ptr); } int main() { char*x,*y; x="HELLO"; y=myfunc(x); printf("y = %s ",y); return 0; }

0 Answers  


Which is the best sort method for library management?

1 Answers   Microsoft,


how to execute a program using if else condition and the output should enter number and the number is odd only...

0 Answers  


What are qualifiers in c?

0 Answers  


write the program for prime numbers?

73 Answers   Accenture, Aptech, Infosys, TCS,






What is your favorite subject?

1 Answers   Ericsson, Invendis, Tech Mahindra,


what is the structure?

4 Answers   TCS,


How can you find out how much memory is available?

0 Answers  


21. #define square(x) x*x main() { int i; i = 64/square(4); printf("%d",i); }

3 Answers  


main() { char *p; p="Hello"; printf("%c\n",*&*p); }

2 Answers   ME,


How does the assert() function work?

2 Answers  


Write a program in c to input a 5 digit number and print it in words.

11 Answers  


Categories