change the value of the i without changing code of the main function, assign 20 to i ?
int fun()
{ //write a code here
/* method 1 #define fun() i=20 */
//method 2
int j;
int *ptr;
ptr=&j;
for (;*(ptr)!=10;ptr++);
*ptr=20;
}
int main()
{
int i=10;
fun(); //substitute i=20
printf("%d",i);
}
No comments:
Post a Comment