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

how to print the character with maximum occurence and print that number of occurence too in a string given ?

0 Answers   Microsoft,


How would you rename a function in C?

0 Answers   Tech Mahindra,


How can I ensure that integer arithmetic doesnt overflow?

0 Answers  


Explain how can I convert a number to a string?

0 Answers  


if ENTERED FIVE DIGITS DESIGN A PROGRAM THAT WILL FIND CORRESPONDING VALUE FROM ASCII TABLE

1 Answers  






What is array of pointers to string?

0 Answers  


There are N egg baskets and the number of eggs in each basket is a known quantity. Two players take turns to remove these eggs from the baskets. On each turn, a player must remove at least one egg, and may remove any number of eggs provided they all belong to the same basket. The player picking the last egg(s) wins the game. If you are allowed to decide who is going to start first, what mathematical function would you use to decide so that you end up on the winning side?

1 Answers   Hathway,


what is the answer for it main() { int i; clrscr(); printf("%d",&i)+1; scanf("%d",i)-1; }

3 Answers  


program to get the remainder and quotant of given two numbers with out using % and / operators?

10 Answers   College School Exams Tests, IBM,


What is the scope of global variable in c?

0 Answers  


Define and explain about ! Operator?

0 Answers  


What are the advantages of using linked list for tree construction?

0 Answers  


Categories