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

What are predefined functions in c?

0 Answers  


What is a structure and why it is used?

0 Answers   Hexaware,


What is the -> in c?

0 Answers  


Explain how do you generate random numbers in c?

0 Answers  


Explain how are 16- and 32-bit numbers stored?

0 Answers  






How to reverse a string using a recursive function, with swapping?

5 Answers  


What is an volatile variable?

15 Answers   HP,


hOW Can I add character in to pointer array of characters char *a="indian"; ie I want to add google after indian in the char *a

1 Answers  


there is two conditions , 1. while using for loop for printing 1 to 50 no's simulteneous 2. while using printf functios for printing 1 to 50 no's simulteneous with or without using variables who will take more time for compiling and execution? explain in details with reason?

1 Answers  


what is the code for getting the output as * ** ***

5 Answers   Caritor,


What are the types of functions in c?

0 Answers  


to find the program of matrix multiplication using arrays

6 Answers   Bhel,


Categories