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

Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.

2 Answers   Wipro,


main() { char str1[] = {‘s’,’o’,’m’,’e’}; char str2[] = {‘s’,’o’,’m’,’e’,’\0’}; while (strcmp(str1,str2)) printf(“Strings are not equal\n”); }

1 Answers  


Design an implement of the inputs functions for event mode

0 Answers   Wipro,


Is the following code legal? struct a { int x; struct a *b; }

2 Answers  


#define int char main() { int i=65; printf("sizeof(i)=%d",sizeof(i)); }

1 Answers  






Write a program using one dimensional array to assign values and then display it on the screen. Use the formula a[i]=i*10 to assign value to an element.

1 Answers   Samar State University,


How do you write a program which produces its own source code as its output?

7 Answers  


1) int i=5; j=i++ + i++ + i++; printf("%d",j);This code gives the answer 15.But if we replace the value of the j then anser is different?why? 2)int i=5; printf("%d",i++ + i++ + i++); this givs 18.

8 Answers   IBPS, Infosys, TCS,


How can i find first 5 natural Numbers without using any loop in c language????????

2 Answers   Microsoft,


programming in c lanugaue programm will errror error with two header file one as stdio.h and other one is conio.h

1 Answers  


main() { char a[4]="HELL"; printf("%s",a); }

3 Answers   Wipro,


How to read a directory in a C program?

4 Answers  


Categories