main()
{
if ((1||0) && (0||1))
{
printf("OK I am done.");
}
else
{
printf("OK I am gone.");
}
}
a. OK I am done
b. OK I am gone
c. compile error
d. none of the above
Answers were Sorted based on User's Feedback
Answer / govind verma
OK I am done. reason bollean expression in if evaluate in such manner first (1||0) will execute and first expresiion of this boolean expression is one so control will not goes to chek any thing i.e whole expression evaluate as (1||0)as 1(true) now expression becom like dis if(1&&(0||1))
now (0||1) expressiion will evaluate in this expression value of left hand side of || operator is 0(false) so control goes to check further and right hand side it recieve 1 then the value of wholl expression becom 1 thn nw orignal expression looks like if(1&&1)
nw (1&&1) is evalute in this case control check both the value of the operator(&&) is one then this return 1 otherwise return 0 then orignal expression like this if(1)
1 is nonzero value this mean condition is true then code of if block will be execute which is OK I am done.
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / naveen kumar
ok i am gone...because in this case the condition if((1||0)
&&(0||1)
always remain true. hence the answer is ok i am done...i.e.
(a
| Is This Answer Correct ? | 1 Yes | 1 No |
What is full form of PEPSI
abcdedcba abc cba ab ba a a
main(){ char a[100]; a[0]='a';a[1]]='b';a[2]='c';a[4]='d'; abc(a); } abc(char a[]){ a++; printf("%c",*a); a++; printf("%c",*a); }
Write a program using one dimensional array to assign values and then display it on the screen. Use the formula a[i]=i*10 to assign value to an element.
1 Answers Samar State University,
write a program to find out roots of quadratic equation "x=-b+-(b^2-4ac0^-1/2/2a"
Is it possible to print a name without using commas, double quotes,semi-colons?
main() { printf("%d", out); } int out=100;
void main() { int i=i++,j=j++,k=k++; printf(ā%d%d%dā,i,j,k); }
given integer number,write a program that displays the number as follows: First line :all digits second line : all except the first digit . . . . Last line : the last digit
how to check whether a linked list is circular.
void main() { char ch; for(ch=0;ch<=127;ch++) printf(ā%c %d \nā, ch, ch); }
func(a,b) int a,b; { return( a= (a==b) ); } main() { int process(),func(); printf("The value of process is %d !\n ",process(func,3,6)); } process(pf,val1,val2) int (*pf) (); int val1,val2; { return((*pf) (val1,val2)); }