main()
{
int c=- -2;
printf("c=%d",c);
}
Answer / susie
Answer :
c=2;
Explanation:
Here unary minus (or negation) operator is used
twice. Same maths rules applies, ie. minus * minus= plus.
Note:
However you cannot give like --2. Because --
operator can only be applied to variables as a decrement
operator (eg., i--). 2 is a constant and not a variable.
Is This Answer Correct ? | 18 Yes | 9 No |
main() { int i=_l_abc(10); printf("%d\n",--i); } int _l_abc(int i) { return(i++); }
Write a routine to draw a circle (x ** 2 + y ** 2 = r ** 2) without making use of any floating point computations at all.
2 Answers Mentor Graphics, Microsoft,
Is the following code legal? struct a { int x; struct a b; }
main() { signed int bit=512, i=5; for(;i;i--) { printf("%d\n", bit = (bit >> (i - (i -1)))); } } a. 512, 256, 128, 64, 32 b. 256, 128, 64, 32, 16 c. 128, 64, 32, 16, 8 d. 64, 32, 16, 8, 4
plz send me all data structure related programs
main() { int i=5; printf("%d",++i++); }
what is variable length argument list?
main() { int i=0; for(;i++;printf("%d",i)) ; printf("%d",i); }
main( ) { char *q; int j; for (j=0; j<3; j++) scanf(“%s” ,(q+j)); for (j=0; j<3; j++) printf(“%c” ,*(q+j)); for (j=0; j<3; j++) printf(“%s” ,(q+j)); }
typedef struct error{int warning, error, exception;}error; main() { error g1; g1.error =1; printf("%d",g1.error); }
const int perplexed = 2; #define perplexed 3 main() { #ifdef perplexed #undef perplexed #define perplexed 4 #endif printf("%d",perplexed); } a. 0 b. 2 c. 4 d. none of the above
void main() { int const * p=5; printf("%d",++(*p)); }
3 Answers Infosys, Made Easy, State Bank Of India SBI,