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

What is the difference between fread buffer() and fwrite buffer()?

1132


When should a type cast not be used?

1019


What is queue in c?

1053


Can static variables be declared in a header file?

1027


Where does the name "C" come from, anyway?

1098


How can I find out the size of a file, prior to reading it in?

1128


How can you read a directory in a C program?

1109


What is the full form of getch?

1209


What is the purpose of sprintf() function?

1075


What is operator precedence?

1163


What is time null in c?

1036


Are enumerations really portable?

991


which type of aspect you want from the student.

2131


How arrays can be passed to a user defined function

983


What is the difference between a function and a method in c?

1048