#ifdef something
int some=0;
#endif
main()
{
int thing = 0;
printf("%d %d\n", some ,thing);
}
Answer / susie
Answer :
Compiler error : undefined symbol some
Explanation:
This is a very simple example for conditional compilation.
The name something is not already known to the compiler
making the declaration
int some = 0;
effectively removed from the source code.
Is This Answer Correct ? | 2 Yes | 2 No |
void main() { unsigned giveit=-1; int gotit; printf("%u ",++giveit); printf("%u \n",gotit=--giveit); }
main() { int i=5; printf("%d",++i++); }
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
Give a very good method to count the number of ones in a 32 bit number. (caution: looping through testing each bit is not a solution)
find simple interest & compund interest
x=2 y=3 z=2 x++ + y++; printf("%d%d" x,y);
main() { int a[10]; printf("%d",*a+1-*a+3); }
#define DIM( array, type) sizeof(array)/sizeof(type) main() { int arr[10]; printf(“The dimension of the array is %d”, DIM(arr, int)); }
Write a program to receive an integer and find its octal equivalent?
void main() { int i=5; printf("%d",i++ + ++i); }
Given an array of size N in which every number is between 1 and N, determine if there are any duplicates in it. You are allowed to destroy the array if you like.
21 Answers ABC, eBay, Goldman Sachs, Google, HUP, Microsoft, TATA,
main( ) { int a[ ] = {10,20,30,40,50},j,*p; for(j=0; j<5; j++) { printf(“%d” ,*a); a++; } p = a; for(j=0; j<5; j++) { printf(“%d ” ,*p); p++; } }