In C Programming, If we need to store word “INDIA” then syntax is as below –
char name[];
name = “INDIA”
1 Crore+ students have signed up on EduRev. Have you? Download the App |
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++)
printf("%d ", arr[i]);
}
int main()
{
int arr[] = {1, 2, 3, 4, 5, 6, 7, 8};
print(arr);
return 0;
}
Which of the following accesses the seventh element stored in array?
What will be the output of the following code?
#include"stdio.h"
void main()
{
int a[10];
printf("%d %d", a[-1], a[12]);
}
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 give compile-time errors if used as left hand sides of assignment statements in a C program (GATE CS 2003)?
What is the output of this program?
#include < stdio.h >
using namespace std;
int main()
{
int array[] = {10, 20, 30};
cout << -2[array];
return 0;
}
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 + n - 1) += 10;
}
void printArr(int* arr, int n)
{
int i;
for(i = 0; i < n; ++i)
printf("%d ", arr[i]);
}
int main()
{
int arr[] = {10, 20, 30};
int size = SIZE(arr);
fun(arr, size);
printArr(arr, size);
return 0;
}
What is the index number of the last element of an array with 9 elements?