implement NAND gate logic in C code without using any
bitwise operatior.
Answers were Sorted based on User's Feedback
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 |
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 |
how many times of error occur in C
What is the use of bitwise operator?
I came across some code that puts a (void) cast before each call to printf. Why?
Why is it important to memset a variable, immediately after allocating memory to it ?
declare afunction pointer to int printf(char *)?
how to go with this?
find the size of structure without using the size of function
Program to write some contents into a file using file operations with proper error messages.
main() { int x=5; printf("%d %d %d\n",x,x<<2,x>>2); }
11 Answers CISOC, CitiGroup, College School Exams Tests,
What is the difference between functions abs() and fabs()?
What is clrscr in c?
what is difference between overriding and overloading?