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 you please explain the difference between exit() and _exit() function?
What is openmp in c?
Why is extern used in c?
Are local variables initialized to zero by default in c?
#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??
what is the significance of static storage class specifier?
What’s a signal? Explain what do I use signals for?
What is a constant and types of constants in c?
1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.
What are the 5 elements of structure?
What is meant by type specifiers?
What is void main () in c?
What is the default value of local and global variables in c?
How can I write a function analogous to scanf?
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }