Friday 9 June 2017

Write a C program to modify the constant variable.

Q : Write a C program to modify the constant variable.

Solution : 


#include<stdio.h>
void main()
{
const int a=1;
int *p;
p=&a;
printf("\n%d",a);
*p=2;
printf("\n%d",a);
}

No comments:

Post a Comment