can we declare a variable in different scopes with different
data types? answer in detail
Answer Posted / tatukula
Yes,
why because that variable scope is ends with in that block only...
int main()
{
int a=20;
printf("%d\n",a);
{
char a='c';
printf("%c\n",a);
}
printf("%d\n",a);
}
output: 20 c 20
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Can we use any name in place of argv and argc as command line arguments?
What are near, far and huge pointers?
What is return in c programming?
a=10;b= 5;c=3;d=3; if(a printf(%d %d %d %d a,b,c,d) else printf("%d %d %d %d a,b,c,d);
What are the storage classes in C?
Explain how do I determine whether a character is numeric, alphabetic, and so on?
Why & is used in c?
What is use of integral promotions in c?
When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?
What is signed and unsigned?
What are types of preprocessor in c?
How to define structures? ·
This is a variation of the call_me function in the previous question:call_me (myvar)int *myvar;{ *myvar += 5; }The correct way to call this function from main() will be a) call_me(myvar) b) call_me(*myvar) c) call_me(&myvar) d) expanded memory
in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none
What is the purpose of sprintf?