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 |
Differentiate b/w Modify and Update commands giving example.
Write a program which take a integer from user and tell whether the given variable is squar of some number or not. eg: is this number is 1,4,9,16... or not
In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none
What is the size of structure in c?
what is a function prototype?
the maximum width of a c variable name can be a) 6 characters b) 8 characters c) 10 characters d) 20 characters
how to find turn around time in operating system?
What are the benefits of organizational structure?
wap in c to accept n number display the highest and lowest value
in linking some of os executables are linking name some of them
What is identifier in c?
How to write a program to receive an integer & find its octal equivalent by using for loop?