Skip to content

Tag Archives: C-Arrays

Data Types Data-type in simple terms gives us information about the type of data. Example, integer, character, etc. Data-types in C language are declarations for the… Read More
Given an integer array of size N, the task is to traverse and print the elements in the array. Examples: Input: arr[] = {2, -1,… Read More
Given an array arr[] of size N, the task is to sort this array in ascending order in C.Examples:  Input: arr[] = {0, 23, 14,… Read More
An array is a collection of items stored at contiguous memory locations. In this article, we will see how to insert an element in an… Read More
Array in C An array is collection of items stored at continuous memory locations. Structure in C A structure is a user defined data type… Read More
New programmers are usually in the search of ways to return multiple values from a function. Unfortunately, C and C++ do not allow this directly.… Read More
Prerequisite – Array Basics Given an array, write a program to find the sum of values of even and odd index positions separately. Examples: Input… Read More
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