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 can i include my own .h file EX:- alex.h like #include<alex.h>, rather than #include"alex.h"
What are nested functions in c?
Write a program to find the biggest number of three numbers in c?
hi... can anyone help me to make a two-dimensinal arrays in finding the sum of two elements plzzz. thnx a lot...
write the output of following code .. main() { static int a[]={10,20,30,40,50}; int *ptr=a; static int arr[2][2]={1,2,3,4}; char str[]="ABCD * 4#"; char *s=str+2; int i,j; for(i=0;i<5,i++) printf("%d",*ptr++); for(i=0;i<2;i++) for(j=0;j<2;j++) printf("%d\n",*(*(n+i)+j)); printf("%c\n%c\n%c\n",*(str+2),*s++,*--s); }
What is variable in c with example?
How to compare array with pointer in c?
what is the use of #pragma pack, wer it is used?
which is the best antivirus and how to update it
Do you know the use of 'auto' keyword?
what is the difference between these initializations? Char a[]=”string”; Char *p=”literal”; Does *p++ increment p, or what it points to?
write a c program to add two integer numbers without using arithmetic operator +