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


Please Help Members By Posting Answers For Below Questions

What are the different types of constants?

849


What does 2n 4c mean?

988


What is string concatenation in c?

784


Why is c faster?

778


any function have arguments one or more OR not . it is compulsary a) any function compulsary have one or more arguments b) any function did not have arguments. It is not compulsary c) it is optional it is not compulsary d) none of the above

869


write a program to display all prime numbers

1689


typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?

1402


Why is C language being considered a middle level language?

856


What do the functions atoi(), itoa() and gcvt() do?

925


What are types of functions?

773


What is difference between && and & in c?

863


A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor

869


Explain how can I pad a string to a known length?

903


Why we use conio h in c?

901


What is the difference between if else and switchstatement

1584