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 |
What 'lex' does?
Is c is a high level language?
Write a client and server program in C language using UDP, where client program interact with the Server as given below: i) The client begins by sending a request to send a string of 8 characters or series of 7 numbers, the server sends back a characters or numbers as per the request of the client. ii) In case of series of 7 numbers: The client sends a multiplication of numbers, to the server. iii) In case of a string of 8 characters: The client sends a reverse order of string to the server.. iv) Server will send an acknowledgment to the client after receiving the correct answer
Write a program to input the price of 1 burger and the number of burgers eaten by a group of friends .print the total amount to be paid by the group?
When was c language developed?
what is the function of void main()?
do you think its fraud or original company?
difference between string and array?
program for following output using for loop? 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5
What are the features of c language?
What are pointers?
0 Answers Accenture, Tavant Technologies, Zensar,
There are N egg baskets and the number of eggs in each basket is a known quantity. Two players take turns to remove these eggs from the baskets. On each turn, a player must remove at least one egg, and may remove any number of eggs provided they all belong to the same basket. The player picking the last egg(s) wins the game. If you are allowed to decide who is going to start first, what mathematical function would you use to decide so that you end up on the winning side?