adplus-dvertising
frame-decoration

Question

How many times the loop will execute ?
#include <stdio.h>
int main()
{
    char str[10] = "98765", *p;
    p = str + 1;
    *p = '0' ;
    printf ("%s", str);
}

a.

98

b.

0

c.

98766

d.

90765

Posted under C Programming

Answer: (d).90765

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. How many times the loop will execute ?