implement NAND gate logic in C code without using any
bitwise operatior.

Answers were Sorted based on User's Feedback



implement NAND gate logic in C code without using any bitwise operatior...

Answer / laxmi bose

#include<stdio.h>
main()
{
int a,b;
scanf("%d%d",&a,&b);
if(a==0||b==0)
{
printf("1");
}
else
{
printf("0");
}

Is This Answer Correct ?    42 Yes 13 No

implement NAND gate logic in C code without using any bitwise operatior...

Answer / senthil.cp

NAND using Bitwise operators
c = ~(a & b) OR
c = ~a | ~b

NAND without using bitwise operators

c = (0xFF - a) + (0xFF - b)

Is This Answer Correct ?    35 Yes 16 No

implement NAND gate logic in C code without using any bitwise operatior...

Answer / vadivel t

int a, b;
scanf("%d %d", &a, &b);
if(a != 0 || b != 0)
{
printf("1");
}
else
{
printf("0");
}

Is This Answer Correct ?    28 Yes 20 No

implement NAND gate logic in C code without using any bitwise operatior...

Answer / qwake

!(a*b)

Is This Answer Correct ?    6 Yes 4 No

Post New Answer

More C Interview Questions

wat are the two methods for swapping two numbers without using temp variable??

2 Answers  


Is it cc or c in a letter?

0 Answers  


What is static function in c?

0 Answers  


What is the Difference between Class and Struct?

10 Answers   Motorola,


Write a program to swap two numbers without using third variable in c?

0 Answers  


c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above

0 Answers  


How to draw the flowchart for structure programs?

0 Answers  


how many times of error occur in C

11 Answers  


What does volatile do?

0 Answers  


what is c?

13 Answers   Tech Mahindra,


a=(1,2,3); b=1,2,3; c=1,(2,3); d=(1,2),3; what's the value of 'a','b','c','d'

2 Answers  


what is the difference between strcpy() and memcpy() function?

2 Answers  


Categories