Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


main()

{

char s[ ]="man";

int i;

for(i=0;s[ i ];i++)

printf("\n%c%c%c%c",s[ i ],*(s+i),*(i+s),i[s]);

}



main() { char s[ ]="man"; int i; for(i=0;s[ i ];i++) printf("\n..

Answer / susie

Answer :

mmmm

aaaa

nnnn

Explanation:

s[i], *(i+s), *(s+i), i[s] are all different
ways of expressing the same idea. Generally array name is
the base address for that array. Here s is the base address.
i is the index number/displacement from the base address.
So, indirecting it with * is same as s[i]. i[s] may be
surprising. But in the case of C it is same as s[i].

Is This Answer Correct ?    37 Yes 7 No

Post New Answer

More C Code Interview Questions

#include<stdio.h> main() { char s[]={'a','b','c','\n','c','\0'}; char *p,*str,*str1; p=&s[3]; str=p; str1=s; printf("%d",++*p + ++*str1-32); }

2 Answers   CNSI,


how can i search an element in an array

2 Answers   CTS, Microsoft, ViPrak,


void main() { int k=ret(sizeof(float)); printf("\n here value is %d",++k); } int ret(int ret) { ret += 2.5; return(ret); }

1 Answers  


main() { char name[10],s[12]; scanf(" \"%[^\"]\"",s); } How scanf will execute?

2 Answers  


write a program to find out roots of quadratic equation "x=-b+-(b^2-4ac0^-1/2/2a"

2 Answers  






#include<stdio.h> main() { char s[]={'a','b','c','\n','c','\0'}; char *p,*str,*str1; p=&s[3]; str=p; str1=s; printf("%d",++*p + ++*str1-32); }

1 Answers  


pls anyone can help me to write a code to print the values in words for any value.Example:1034 to print as "one thousand and thirty four only"

2 Answers  


main() { extern out; printf("%d", out); } int out=100;

1 Answers  


#define clrscr() 100 main() { clrscr(); printf("%d\n",clrscr()); }

2 Answers  


Give a oneline C expression to test whether a number is a power of 2?

25 Answers   EA Electronic Arts, Google, Motorola,


main() { int i; clrscr(); printf("%d", &i)+1; scanf("%d", i)-1; } a. Runtime error. b. Runtime error. Access violation. c. Compile error. Illegal syntax d. None of the above

1 Answers   HCL,


void main() { int i=5; printf("%d",i+++++i); }

3 Answers  


Categories