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=1; while (i<=5) { printf("%d",i); if (i>2) goto here; i++; } } fun() { here: printf("PP"); }
Write a C program to add two numbers before the main function is called.
main() { int i=10,j=20; j = i, j?(i,j)?i:j:j; printf("%d %d",i,j); }
Write a function to find the depth of a binary tree.
13 Answers Adobe, Amazon, EFI, Imagination Technologies,
main(){ int a= 0;int b = 20;char x =1;char y =10; if(a,b,x,y) printf("hello"); }
main() { int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }
Declare an array of N pointers to functions returning pointers to functions returning pointers to characters?
#include <stdio.h> main() { char * str = "hello"; char * ptr = str; char least = 127; while (*ptr++) least = (*ptr<least ) ?*ptr :least; printf("%d",least); }
main() { register int a=2; printf("Address of a = %d",&a); printf("Value of a = %d",a); }
main() { extern int i; i=20; printf("%d",sizeof(i)); }
main() { struct student { char name[30]; struct date dob; }stud; struct date { int day,month,year; }; scanf("%s%d%d%d", stud.rollno, &student.dob.day, &student.dob.month, &student.dob.year); }
#include <stdio.h> int main(void) { int a=4, b=2; a=b<<a+b>>2 ; printf("%d",a); return 0; }