Skip to content

Tag Archives: C-Arrays

In C, array name represents address and when we pass an array, we actually pass address and the parameter receiving function always accepts them as… Read More
Given two arrays such that first array has enough extra space to accommodate elements of second array. How to concatenate second array to first in… Read More
#include <stdio.h> int main() {     char p;     char buf[10] = {1, 2, 3, 4, 5, 6, 9, 8};     p = (buf + 1)[5];     printf("%d\n", p);… Read More
#include<stdio.h> int main() {     int a[10][20][30] = {0};     a[5][2][1] = 2;     return 0; } Which of the following will print the value 2 for the… Read More
#include <stdio.h>    int main() {     int a[][] = {{1,2},{3,4}};     int i, j;     for (i = 0; i < 2; i++)         for (j = 0;… Read More
Does C perform array out of bound checking? What is the output of the following program? int main() {     int i;     int arr[5] = {0};… Read More
Predict output of following program int main() {     int i;     int arr[5] = {1};     for (i = 0; i < 5; i++)         printf("%d ", arr[i]);… Read More
Predict the output of the below program: #include <stdio.h> #define SIZE(arr) sizeof(arr) / sizeof(*arr); void fun(int* arr, int n) {     int i;     *arr += *(arr… Read More
Which of the following is true about arrays in C. (A) For every type T, there can be an array of T. (B) For every… Read More
Consider the following declaration of a ‘two-dimensional array in C: char a[100][100];  Assuming that the main memory is byte-addressable and that the array is stored… Read More
Assume the following C variable declaration int *A [10], B[10][10];   Of the following expressions I A[2] II A[2][3] III B[1] IV B[2][3] which will not… Read More
Consider the following C-function in which a[n] and b[m] are two sorted integer arrays and c[n + m] be another integer array. void xyz(int a[],… Read More
Output of following program? #include<stdio.h>       int main()  {    int a[] = {1, 2, 3, 4, 5, 6};    int *ptr = (int*)(&a+1);    printf("%d ", *(ptr-1)… Read More
What is output? # include <stdio.h>    void print(int arr[]) {    int n = sizeof(arr)/sizeof(arr[0]);    int i;    for (i = 0; i < n; i++)… Read More
Predict the output of below program: #include <stdio.h>    int main() {     int arr[5];     // Assume base address of arr is 2000 and size of… Read More

Start Your Coding Journey Now!