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
What are the 32 keywords in c?
What is bubble sort technique in c?
Describe the steps to insert data into a singly linked list.
How can I open a file so that other programs can update it at the same time?
Is there sort function in c?
What is character set?
Describe the header file and its usage in c programming?
What is getch?
What is f'n in math?
Why is c called a mid-level programming language?
Tell us the use of fflush() function in c language?
Define C in your own Language.
Explain how can I make sure that my program is the only one accessing a file?
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
How do you list files in a directory?