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 |
WHAT IS MEANT BY LIFE?
find the sum of two matrices and WAP for it.
for questions 14,15,16,17 use the following alternatives:a.int b.char.c.string.d.float
what is the different between data structure and data type?
what is the output of the following program? main() { int c[]={2,8,3,4,4,6,7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) { printf("%d",*c); ++q; } for(j=0;j<5;j++) { printf("%d",*p); ++p; } }
Explain how are portions of a program disabled in demo versions?
Explain how to reverse singly link list.
If I want to initialize the array like. int a[5] = {0}; then it gives me all element 0. but if i give int a[5] = {5}; then 5 0 0 0 0 is ans. what will I do for all element 5 5 5 5 5 in a single statement???
what is the difference between 123 and 0123 in c?
what is the purpose of the code, and is there any problem with it. unsigned int v[10]; unsigned int i = 0; while (i < 10) v[i] = i++;
WAP TO ACCEPT STRING AND COUNT A COMES N TIMES B COMES N TIMES C COMES N TIMES D COMES N TIMES AND SO ON......... AT LAST UNTIL Z COMES N TIMES...............
the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b