Write a program in C for showing working of different
logical operator in C.
Your program should guide users with proper message/menu on
the console.
Answer Posted / chauhan varsha
#include<stdio.h>
void main()
{
int a=5,b=8,c=9,d=2;
clrscr();
if((a==b)&&(a==c))
{
printf("value is same. check 3 values using logical
operator..");
}
else if((a!>b) || (a!>c))
{
printf("value of a is not grater from b & c check
using logical operator or & not...");
}
getch();
}
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
What is the c value paradox and how is it explained?
Are bit fields portable?
Which control loop is recommended if you have to execute set of statements for fixed number of times?
What are header files and explain what are its uses in c programming?
What is fflush() function?
What is the meaning of c in c language?
Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].
What is 1d array in c?
Write a program to reverse a given number in c?
What do you mean by invalid pointer arithmetic?
What is pointer to pointer in c?
What is the use of putchar function?
Explain what is the difference between null and nul?
What does do in c?
Which is more efficient, a switch statement or an if else chain?