Arrays Questions and Answers updated daily – C Language



13 Arrays Questions and answers section with explanation for various online exam preparation, various interviews, C Language Arrays online test. Arrays Questions with detailed description, explanation will help you to master the topic.

Arrays Questions

1.
Which of the following statements are correct about 6 used in the program?
int num[6];
num[6]=21;



SHOW ANSWER
Correct Ans:In the first statement 6 specifies a array size, whereas in the second statement it specifies a particular element of array.
Explanation:


2.
Which of the following statements are correct about an array?
1: The array int num[26]; can store 26 elements.
2: The expression num[1] designates the very first element in the array.
3: It is necessary to initialize the array at the time of declaration.
4: The declaration num[SIZE] is allowed if SIZE is a macro.



SHOW ANSWER
Correct Ans:1,4
Explanation:


3.
What will be the output of the program if the array begins 1200 in memory?

#include<stdio.h>

int main()
{
    int arr[]={2, 3, 4, 1, 6};
    printf("%u, %u, %un", arr, &arr[0], &arr);
    return 0;
}



Fresherslive Current Affairs

SHOW ANSWER
Correct Ans:1200,1200,1200
Explanation:


4.
   What will be the output of the program ?

#include

int main()
{
    float arr[] = {12.4, 2.3, 4.5, 6.7};
    printf("%dn", sizeof(arr)/sizeof(arr[0]));
    return 0;
}



SHOW ANSWER
Correct Ans:4
Explanation:


5.
What will be the output of the program ?

#include<stdio.h>

int main()
{
    int arr[1]={10};
    printf("%dn", 0[arr]);
    return 0;
}



Fresherslive Current Affairs

SHOW ANSWER
Correct Ans:10
Explanation:


6.
What will be the output of the program in Turb C (under DOS)?

#include<stdio.h>

int main()
{
    int arr[5], i=0;
    while(i<5)
        arr[i]=++i;

    for(i=0; i<5; i++)
        printf("%d, ", arr[i]);

    return 0;
}



SHOW ANSWER
Correct Ans:garbage value 1,2,3,4
Explanation:


7. What will be the output of the program if the array begins at 65472 and each integer occupies 2 bytes?
#include<stdio.h>

int main()
{
    int a[3][4] = {1, 2, 3, 4, 4, 3, 2, 1, 7, 8, 9, 0};
    printf("%u, %un", a+1, &a+1);
    return 0;
}



SHOW ANSWER
Correct Ans:65480,65496
Explanation:


8.
What will be the output of the program ?

#include<stdio.h>
void fun(int **p);

int main()
{
    int a[3][4] = {1, 2, 3, 4, 4, 3, 2, 8, 7, 8, 9, 0};
    int *ptr;
    ptr = &a[0][0];
    fun(&ptr);
    return 0;
}
void fun(int **p)
{
    printf("%dn", **p);
}



SHOW ANSWER
Correct Ans:1
Explanation:


9.
What will be the output of the program ?

#include<stdio.h>

int main()
{
    void fun(int, int[]);
    int arr[] = {1, 2, 3, 4};
    int i;
    fun(4, arr);
    for(i=0; i<4; i++)
        printf("%d,", arr[i]);
    return 0;
}
void fun(int n, int arr[])
{
    int *p=0;
    int i=0;
    while(i++ < n)
        p = &arr[i];
    *p=0;
}



SHOW ANSWER
Correct Ans:1,2,3,4
Explanation:


10.
What will be the output of the program ?

#include<stdio.h>

int main()
{
    int a[5] = {5, 1, 15, 20, 25};
    int i, j, m;
    i = ++a[1];
    j = a[1]++;
    m = a[i++];
    printf("%d, %d, %d", i, j, m);
    return 0;
}



Fresherslive Current Affairs

SHOW ANSWER
Correct Ans:3,2,15
Explanation:


11. In C, if you pass an array as an argument to a function, what actually gets passed?



SHOW ANSWER
Correct Ans:Base address of the array
Explanation:
The statement 'C' is correct. When we pass an array as a funtion argument, the base address of the array will be passed.


12.
What does the following declaration mean?
int (*ptr)[10];



SHOW ANSWER
Correct Ans:ptr is a pointer to an array of 10 integers
Explanation:


13. What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array?



SHOW ANSWER
Correct Ans:The program may crash if some important data gets overwritten
Explanation:


Are you seeking for good platform for practicing Arrays questions in online. This is the right place. The time you spent in Fresherslive will be the most beneficial one for you.

Online Test on Arrays @ Fresherslive

This page provides important questions on Arrays along with correct answers and clear explanation, which will be very useful for various Interviews, Competitive examinations and Entrance tests. Here, Most of the Arrays questions are framed with Latest concepts, so that you may get updated through these Arrays Online tests. Arrays Online Test questions are granted from basic level to complex level.

Why To Practice Arrays Test questions Online @ Fresherslive?

Arrays questions are delivered with accurate answer. For solving each and every question, very lucid explanations are provided with diagrams wherever necessary.

Practice in advance of similar questions on Arrays may improve your performance in the real Exams and Interview.

Time Management for answering the Arrays questions quickly is foremost important for success in Competitive Exams and Placement Interviews.

Through Fresherslive Arrays questions and answers, you can acquire all the essential idea to solve any difficult questions on Arrays in short time and also in short cut method.

Winners are those who can use the simplest method for solving a question. So that they have enough time for solving all the questions in examination, correctly without any tense. Fresherslive provides most simplest methods to answer any tough questions. Practise through Fresherslive test series to ensure success in all competitive exams, entrance exams and placement tests.

Why Fresherslive For Arrays Online Test Preparation?

Most of the job seekers finding it hard to clear Arrays test or get stuck on any particular question, our Arrays test sections will help you to success in Exams as well as Interviews. To acquire clear understanding of Arrays, exercise these advanced Arrays questions with answers.

You're Welcome to use the Fresherslive Online Test at any time you want. Start your beginning, of anything you want by using our sample Arrays Online Test and create yourself a successful one. Fresherslive provides you a new opportunity to improve yourself. Take it and make use of it to the fullest. GOODLUCK for Your Bright Future.




SSC CHSL Tier-I - Advanced
Latest pattern
Clear explanation
Access via
+
Rs. 49
Rs.800
Buy Now


Premium Package
200+ Mock Test Series
Validity 12 months
Rs. 399
2200
Buy Now


SBI Clerk 2019
Latest pattern
Clear explanation
Access via
+
Rs. 49
Rs.800
Buy Now


RRB NTPC 2019
Latest pattern
Clear explanation
Access via
+
Rs. 49
Rs.800
Buy Now


LIC ADO PRELIMS 2019
Latest pattern
Clear explanation
Access via
+
Rs. 49
Rs.800
Buy Now


DRDO- TECHNICIAN A - TIER I
Latest pattern
Clear explanation
Access via
+
Rs. 49
Rs.800
Buy Now


ONGC Executive E1 Level
Latest pattern
Clear explanation
Access via
+
Rs. 49
Rs.400
Buy Now


IBPS RRB Officer Scale I PRELIMS
Latest pattern
Clear explanation
Access via
+
Rs. 49
Rs.800
Buy Now


SOUTH INDIAN BANK CLERK 2019
Latest pattern
Clear explanation
Access via
+
Rs. 49
Rs.800
Buy Now


IBPS RRB Office Assistant Prelims 2019
Latest pattern
Clear explanation
Access via
+
Rs. 49
Rs.800
Buy Now


IBPS PO PRELIMS 2019
Latest pattern
Clear explanation
Access via
+
Rs. 49
Rs.800
Buy Now


One Month Pass
200+ Test Series
20,000+ Questions
Six Months Unlimited Access
Rs. 99
500
Buy Now


SSC MTS 2019
Latest pattern
Clear explanation
Access via
+
Rs. 49
Rs.800
Buy Now


Six Month Pass
200+ Test Series
20,000+ Questions
Six Months Unlimited Access
Rs. 199
1200
Buy Now


SSC Selection Posts Phase VII Matriculation Level
Latest pattern
Clear explanation
Access via
+
Rs. 49
Rs.800
Buy Now


RBI Assistant Prelims
Latest pattern
Clear explanation
Access via
+
Rs. 49
Rs.800
Buy Now


NABARD Development Assistant Prelims
Latest pattern
Clear explanation
Access via
+
Rs. 49
Rs.800
Buy Now


LIC Assistant Prelims
Latest pattern
Clear explanation
Access via
+
Rs. 49
Rs.800
Buy Now



×

Get Unlimited Mock Tests


Unlock all 200+ Mock Tests series


12 Month Pass
Rs. 399
for 365 days

6 Month Pass
Rs. 199
for 180 days

One Month Pass
Rs. 99
for 30 Days



***Crack All Banking | Railways | SSC | Insurance | More Govt Exams***


FreshersLive - No.1 Job site in India. Here you can find latest 2019 government as well as private job recruitment notifications for different posts vacancies in India. Get top company jobs for both fresher and experienced. Job Seekers can get useful interview tips, resume services & interview Question and answer. Practice online test free which is helpful for interview preparation. Register with us to get latest employment news/rojgar samachar notifications. Also get latest free govt and other sarkari naukri job alerts daily through E-mail.