main(){

char a[100];

a[0]='a';a[1]]='b';a[2]='c';a[4]='d';

abc(a);

}

abc(char a[]){

a++;

printf("%c",*a);

a++;

printf("%c",*a);

}

Answers were Sorted based on User's Feedback



main(){ char a[100]; a[0]='a';a[1]]='b';a[2]='c';a..

Answer / susie

Explanation:

The base address is modified only in function and as a
result a points to 'b' then after incrementing to 'c' so bc
will be printed.

Is This Answer Correct ?    1 Yes 1 No

main(){ char a[100]; a[0]='a';a[1]]='b';a[2]='c';a..

Answer / romeyo

bc

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Code Interview Questions

create a login program that ask username and password. if you input username or password 3 times wrong, the program will terminate else the program will prompt a message "congratulations"

2 Answers  


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

2 Answers   HCL,


main() { int i=0; for(;i++;printf("%d",i)) ; printf("%d",i); }

1 Answers   Zoho,


main() { char p[ ]="%d\n"; p[1] = 'c'; printf(p,65); }

2 Answers  


Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange

0 Answers  






Write a Program that Inputs 10 Numbers in an Array and Show the Maximum Number

2 Answers   Ace Info,


plz send me all data structure related programs

2 Answers  


Sorting entire link list using selection sort and insertion sort and calculating their time complexity

1 Answers   Infosys, Microsoft, NetApp,


Program to find the largest sum of contiguous integers in the array. O(n)

11 Answers  


main() { signed int bit=512, mBit; { mBit = ~bit; bit = bit & ~bit ; printf("%d %d", bit, mBit); } } a. 0, 0 b. 0, 513 c. 512, 0 d. 0, -513

3 Answers   HCL, Logical Computers,


C statement to copy a string without using loop and library function..

2 Answers   Persistent, TCS,


What is the output for the following program main() { int arr2D[3][3]; printf("%d\n", ((arr2D==* arr2D)&&(* arr2D == arr2D[0])) ); }

1 Answers  


Categories