Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

study the code:
#include<stdio.h>
void main()
{
const int a=100;
int *p;
p=&a;
(*p)++;
printf("a=%dn(*p)=%dn",a,*p);
}
What is printed?
A)100,101 B)100,100 C)101,101 D)None of the
above

Answer Posted / abdur rab

the answer is c) 101, 101

a constant variable can be accessed using a pointer to
change the value because, during compilation the compiler
cannot see that the pointer is changing a contant read only
variable.

the same method can be applied over the private members in
a c++ class also.

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is struct node in c?

1073


how to create duplicate link list using C???

2558


please explain every phase in the "SDLC" in the dotnet.

2612


What are the advantages of union?

1067


Explain what is #line used for?

1061


what will be maximum number of comparisons when number of elements are given?

1902


.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }

1292


Differentiate Source Codes from Object Codes

1564


How do I read the arrow keys? What about function keys?

1082


Not all reserved words are written in lowercase. TRUE or FALSE?

1231


write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);

2355


Does sprintf put null character?

1037


What are the application of c?

1093


The difference between printf and fprintf is ?

1281


What are formal parameters?

1112