write a program to compare 2 numbers without using logical
operators?
Answer Posted / r.aruna
#include<stdio.h>
#include<conio.h>
void main()
{
int a;
int b;
clrscr();
printf("enter the a value=");
scanf("%d",&a);
printf("enter the b value=");
scanf("%d",&b);
if(a==b)
{
printf("a is greater");
}
else
{
printf("b is greater");
}
getch();
}
| Is This Answer Correct ? | 4 Yes | 15 No |
Post New Answer View All Answers
If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402
What is wrong with this declaration?
What is #define?
Can we use visual studio for c?
Simplify the program segment if X = B then C ← true else C ← false
Where register variables are stored in c?
Hai what is the different types of versions and their differences
What is a void * in c?
define string ?
Explain how can I prevent another program from modifying part of a file that I am modifying?
When should structures be passed by values or by references?
How many bytes are occupied by near, far and huge pointers (dos)?
A banker has a seif with a cipher. Not to forget the cipher, he wants to write it coded as following: each digit to be replaced with the difference of 9 with the current digit. The banker chose a cipher. Decipher it knowing the cipher starts with a digit different than 9. I need to write a program that takes the cipher from the keyboard and prints the new cipher. I thought of the following: Take the input from the keyboard and put it into a string or an array. Go through the object with a for and for each digit other than the first, substract it from 9 and add it to another variable. Print the new variable. Theoretically I thought of it but I don't know much C. Could you give me any kind of hint, whether I am on the right track or not?
Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..
What is a union?