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 |
Should a function contain a return statement if it does not return a value?
what is the use of ~ in c lang?????
WRITE A PROGRAM TO FIND A REVERSE OF TWO NO
Why main is not a keyword in c?
What are the application of c?
How do you define a string?
What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.
Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.
Using which language Test cases are added in .ptu file of RTRT unit testing???
write a program to find a given no. is divisible by 3 or not without using any arthimetic operators?
Write a program that his output 1 12 123
Why does everyone say not to use gets?