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

using only #include <stdio.h> and #include <stdlib.h> Write a program in C that will read an input from the user and print it back to the user if it is a palindrome. The string ends when it encounters a whitespace. The input string is at most 30 characters. Assume the string has no spaces and distinguish between and lowercase. So madam is a palindrome, but MadAm is not a palindrome. Use scanf and %s to read the string. Sample Test: Enter a string: madam madam is a palindrome. Enter a string: 09023 09023 is not a palindrome.

0 Answers  


. Write a program to get a string and to convert the 1st letter of it to uppercase

2 Answers   HTC,


void main() { char c; while(c=getchar()!='\n') printf("%d",c); } o/p=11 why?

8 Answers   Wipro,


What should malloc() do?

0 Answers  


What is the maximum length of an identifier?

0 Answers  


How to add two numbers with using function?

4 Answers  


what is level of tree if leaf node is at level 4.please explain.

1 Answers   Wipro,


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

0 Answers  


Why we use int main and void main?

0 Answers  


void main() { int i=5; printf("%d",i++ + ++i); }

21 Answers   ME,


how to find out the reverse number of a digit if it is input through the keyboard?

6 Answers  


Is c object oriented?

0 Answers  


Categories