main()
{
int i=-1;
+i;
printf("i = %d, +i = %d \n",i,+i);
}
Answer / susie
Answer :
i = -1, +i = -1
Explanation:
Unary + is the only dummy operator in C. Where-ever it
comes you can just ignore it just because it has no effect
in the expressions (hence the name dummy operator).
| Is This Answer Correct ? | 20 Yes | 1 No |
void main() { static int i=i++, j=j++, k=k++; printf(“i = %d j = %d k = %d”, i, j, k); }
Write a C program to print ‘Campus Force training’ without using even a single semicolon in the program.
main() { signed int bit=512, i=5; for(;i;i--) { printf("%d\n", bit >> (i - (i -1))); } } a. 512, 256, 0, 0, 0 b. 256, 256, 0, 0, 0 c. 512, 512, 512, 512, 512 d. 256, 256, 256, 256, 256
struct Foo { char *pName; char *pAddress; }; main() { struct Foo *obj = malloc(sizeof(struct Foo)); clrscr(); obj->pName = malloc(100); obj->pAddress = malloc(100); strcpy(obj->pName,"Your Name"); strcpy(obj->pAddress, "Your Address"); free(obj); printf("%s", obj->pName); printf("%s", obj->pAddress); } a. Your Name, Your Address b. Your Address, Your Address c. Your Name Your Name d. None of the above
What is the subtle error in the following code segment? void fun(int n, int arr[]) { int *p=0; int i=0; while(i++<n) p = &arr[i]; *p = 0; }
Is the following statement a declaration/definition. Find what does it mean? int (*x)[10];
Write a program to implement the motion of a bouncing ball using a downward gravitational force and a ground-plane friction force. Initially the ball is to be projected in to space with a given velocity vector
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
Write a program to check whether the number is prime and also check if it there i n fibonacci series, then return true otherwise return false
main() { int i; float *pf; pf = (float *)&i; *pf = 100.00; printf("\n %d", i); } a. Runtime error. b. 100 c. Some Integer not 100 d. None of the above
Develop a routine to reflect an object about an arbitrarily selected plane
main() { char not; not=!2; printf("%d",not); }