Sunday, November 27, 2011

Output & Errors

void 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]);
}

Output & Errors

void main()
{
  int const *p=100;
  printf("%d" , ++(*p));
}

Successive increase in quantity by certain percentage.

Suppose X units of an item is available. p% is added to it first. Then q% of the increased quantity is added. Again r% of the increased quantity is added.

If the current amount becomes Y unit then, initial amount X is calculated using the following relation: