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 are the 32 keywords in c?

1090


What is bubble sort technique in c?

973


Describe the steps to insert data into a singly linked list.

1068


How can I open a file so that other programs can update it at the same time?

1179


Is there sort function in c?

1010


What is character set?

1166


Describe the header file and its usage in c programming?

1062


What is getch?

1183


What is f'n in math?

1065


Why is c called a mid-level programming language?

1196


Tell us the use of fflush() function in c language?

1138


Define C in your own Language.

1071


Explain how can I make sure that my program is the only one accessing a file?

1218


A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none

1240


How do you list files in a directory?

1138