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...

can we declare a variable in different scopes with different
data types? answer in detail

Answer Posted / rajasekhar

yes we can declare the same variable with different data types in different scopes...


y bcoz as the scope ends the availability of that particular variable also ends..

so, if u create a variable which is declared in the another scope there will be no error...


ex: void main()
{
int a;
}/*the availability of a has ended here*/
int print()
{
char a;

return 0;
}/* as this is next scope, the variabla declared in the main function does not affect this function*/


hope u understood



thank u

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Where static variables are stored in c?

1044


write a progrmm in c language take user interface generate table using for loop?

1998


What are identifiers c?

1023


difference between object file and executable file

6644


Explain what does the function toupper() do?

1007


What are the two types of functions in c?

945


What is c preprocessor mean?

1247


Why can arithmetic operations not be performed on void pointers?

984


write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.

2776


What is const and volatile in c?

992


Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays

2302


Explain what header files do I need in order to define the standard library functions I use?

1118


Can a void pointer point to a function?

974


What are the advantages of using macro in c language?

1072


What are the different types of C instructions?

1246