why do you use macros? Explain a situation where you had to
incorporate macros in your proc report? use a simple
instream data example with code ?
int a=1; printf("%d %d %d",a++,a++,a); need o/p in 'c' and what explanation too
main() { char str1[] = {‘s’,’o’,’m’,’e’}; char str2[] = {‘s’,’o’,’m’,’e’,’\0’}; while (strcmp(str1,str2)) printf(“Strings are not equal\n”); }
main() { extern int i; { int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%d",i); } int i;
main() { int a[10]; printf("%d",*a+1-*a+3); }
void main() { static int i=5; if(--i){ main(); printf("%d ",i); } }
Given a list of numbers ( fixed list) Now given any other list, how can you efficiently find out if there is any element in the second list that is an element of the first list (fixed list)
3 Answers Disney, Google, ZS Associates,
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
main() { int c = 5; printf("%d", main||c); } a. 1 b. 5 c. 0 d. none of the above
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
why java is platform independent?
void main() { static int i; while(i<=10) (i>2)?i++:i--; printf(“%d”, i); }
C program to print magic square of order n where n > 3 and n is odd