in Programming in C edited by
1,358 views
1 vote
1 vote

Q1)

#include<stdio.h>
static int i;
static int i = 27;
static int i;
int main()
{
    static int i;
    printf("%d",i);
    return 0;
}



A) 27      B) 0      C) No Output         D)None of the these

Q2)
 

#include<stdio.h>
static int i;
static int i = 27;
static int i;
int main()
{
    printf("%d",i);
    return 0;
}


A) 27      B) 0      C) No Output         D)None of the these

Q3)
 

#include<stdio.h>
static int i = 0;
static int i = 27;
static int i;
int main()
    {
    printf("%d",i);
    return 0;
    }



A) 27      B) 0      C) No Output         D)None of the these

Q4)
 

#include<stdio.h>
static int i;
static int i = 27;
static int i =0;
int main()
    {
    printf("%d",i);
    return 0;
    }



A) 27      B) 0      C) No Output         D) None of the these

Q5)
 

#include<stdio.h>
static int i;
static int i = 27;
i = 45;
int main()
    {
    printf("%d",i);
    return 0;
    }



A) 27      B) 0      C) No Output         D)None of the these

@Arjun Sir please explain deeply, How to store the static variable in memory?

in Programming in C edited by
1.4k views

1 Answer

–1 vote
–1 vote

1) 0

2) 27

3)error

4)error

5)error becz we cant assign globally