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]);
}
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 |
why array index always strats wuth zero?
‎#define good bad main() { int good=1; int bad=0; printf ("good is:%d",good); }
Link list in reverse order.
C program to print magic square of order n where n > 3 and n is odd
Write a routine that prints out a 2-D array in spiral order
WAP to display 1,2,3,4,5........N
main(int argc, char **argv) { printf("enter the character"); getchar(); sum(argv[1],argv[2]); } sum(num1,num2) int num1,num2; { return num1+num2; }
Derive expression for converting RGB color parameters to HSV values
Ramesh’s basic salary is input through the keyboard. His dearness allowance is 40% of basic salary, and house rent allowance is 20% of basic salary. Write a program to calculate his gross salary.
#if something == 0 int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); }
What is "far" and "near" pointers in "c"...?
void main() { int i=10, j=2; int *ip= &i, *jp = &j; int k = *ip/*jp; printf(ā%dā,k); }