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 |
#define a 10 int main() { printf("%d..",a); foo(); printf("%d..",a); return 0; } void foo() { #undef a #define a 50 }
Finding a number which was log of base 2
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
Write a single line c expression to delete a,b,c from aabbcc
#include"math.h" void main() { printf("Hi everybody"); } if <stdio.h> will be included then this program will must compile, but as we know that when we include a header file in "" then any system defined function find its defination from all the directrives. So is this code of segment will compile? If no then why?
Write a program to receive an integer and find it's octal equivalent. How can i do with using while loop.
main() { int i=3; switch(i) { default:printf("zero"); case 1: printf("one"); break; case 2:printf("two"); break; case 3: printf("three"); break; } }
main(int argc, char **argv) { printf("enter the character"); getchar(); sum(argv[1],argv[2]); } sum(num1,num2) int num1,num2; { return num1+num2; }
write a program in c language to get the value of arroy keys pressed and display the message which arrow key is pressed?
In the following pgm add a stmt in the function fun such that the address of 'a' gets stored in 'j'. main(){ int * j; void fun(int **); fun(&j); } void fun(int **k) { int a =0; /* add a stmt here*/ }
write the function. if all the character in string B appear in string A, return true, otherwise return false.
main() { char p[ ]="%d\n"; p[1] = 'c'; printf(p,65); }