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 / rajiv

int a,b,c,d,m,t;
float x,y,j,k;
scanf("%d\n%d\n%d\n%d\n%d\n%d\n",&a,&b,&c,&d,&m,&t);
scanf("%f\n%f\n%f\n%f\n",&x,&y,&j,&k);
if((a>b && c<d)||(x>y && j<k)||(m!=t))
printf("its demo of logical operator");
else
printf("logical error is there in program");

Is This Answer Correct ?    42 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode

660


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 ].

647


What is typeof in c?

610


What is the function of volatile in c language?

669


What are pointers?

635






What is indirection? How many levels of pointers can you have?

660


How does sizeof know array size?

632


What are lookup tables in c?

551


What are inbuilt functions in c?

561


What are register variables? What are the advantage of using register variables?

688


Is there sort function in c?

579


A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile

649


Explain the properties of union. What is the size of a union variable

718


Write the Program to reverse a string using pointers.

619


What are the 4 types of organizational structures?

626