int a[5] = {1,2,3}
What is the value of a[4]?
int a[5] = {1,2,3}
What is the value of a[4]?
What does the following declaration mean?
int (*ptr)[10];
What does the following declaration mean?
int (*ptr)[10];
The library function used to find the last occurrence of a character in a string is
The library function used to find the last occurrence of a character in a string is
What will be printed after execution of the following code?
void main()
{
int arr[10] = {1,2,3,4,5};
printf("%d", arr[5]);
}
What will be printed after execution of the following code?
void main()
{
int arr[10] = {1,2,3,4,5};
printf("%d", arr[5]);
}
Array passed as an argument to a function is interpreted as
Array passed as an argument to a function is interpreted as
What will be the output of following program code?
#include <stdio.h>
int main(void)
{
char p;
char buf[10] = {1, 2, 3, 4, 5, 6, 9, 8};
p = (buf + 1)[5];
printf("%d", p);
return 0;
}
What will be the output of following program code?
#include <stdio.h>
int main(void)
{
char p;
char buf[10] = {1, 2, 3, 4, 5, 6, 9, 8};
p = (buf + 1)[5];
printf("%d", p);
return 0;
}
Which of the following function is more appropriate for reading in a multi-word string?
Which of the following function is more appropriate for reading in a multi-word string?
What will be the output of the program ?
#include
#include
void main()
{
char str[] = "Exam\0Veda";
printf("%s", str);
}
What will be the output of the program ?
#include
#include
void main()
{
char str[] = "Exam\0Veda";
printf("%s", str);
}
What will be the output of the program ?
#include<stdio.h>
#include<string.h>
void main()
{
char str1[20] = "Hello", str2[20] = " World";
printf("%s", strcpy(str2, strcat(str1, str2)));
}
What will be the output of the program ?
#include<stdio.h>
#include<string.h>
void main()
{
char str1[20] = "Hello", str2[20] = " World";
printf("%s", strcpy(str2, strcat(str1, str2)));
}
Let x be an array. Which of the following operations are illegal?
I. ++x
II. x+1
III. x++
IV. x*2
Let x be an array. Which of the following operations are illegal?
I. ++x
II. x+1
III. x++
IV. x*2
Which of the following correctly accesses the seventh element stored in arr, an array with 100 elements?
Which of the following correctly accesses the seventh element stored in arr, an array with 100 elements?
What will be the output of the following program?
void main()
{
char str1[] = "abcd";
char str2[] = "abcd";
if(str1==str2)
printf("Equal");
else
printf("Unequal");
}
What will be the output of the following program?
void main()
{
char str1[] = "abcd";
char str2[] = "abcd";
if(str1==str2)
printf("Equal");
else
printf("Unequal");
}
What will be the output of the program if the array begins at 65472 and each integer occupies 2 bytes?
#include
void main()
{
int a[3][4] = {1, 2, 3, 4, 4, 3, 2, 1, 7, 8, 9, 0};
printf("%u, %u", a+1, &a+1);
}
What will be the output of the program if the array begins at 65472 and each integer occupies 2 bytes?
#include
void main()
{
int a[3][4] = {1, 2, 3, 4, 4, 3, 2, 1, 7, 8, 9, 0};
printf("%u, %u", a+1, &a+1);
}
What will be the output of the program if the array begins at address 65486?
#include
void main()
{
int arr[] = {12, 14, 15, 23, 45};
printf("%u, %u", arr, &arr);
}
What will be the output of the program if the array begins at address 65486?
#include
void main()
{
int arr[] = {12, 14, 15, 23, 45};
printf("%u, %u", arr, &arr);
}
The function sprintf() works like printf(), but operates on ..........
The function sprintf() works like printf(), but operates on ..........
What is the maximum number of dimensions an array in C may have?
What is the maximum number of dimensions an array in C may have?
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.
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.
What will be the output of the program ?
#include<stdio.h>
void 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);
}
What will be the output of the program ?
#include<stdio.h>
void 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);
}
If the two strings are identical, then strcmp() function returns
If the two strings are identical, then strcmp() function returns
An array elements are always stored in ________ memory locations.
An array elements are always stored in ________ memory locations.
What is the return value of the following statement if it is placed in C program? strcmp("ABC", "ABC");
What is the return value of the following statement if it is placed in C program? strcmp("ABC", "ABC");
What will be the output of the program ?
#include<stdio.h>
void main()
{
printf(5+"Good Morningn");
}
What will be the output of the program ?
#include<stdio.h>
void main()
{
printf(5+"Good Morningn");
}
Which of the following statements are correct about the program below?
#include<stdio.h>
void main()
{
int size, i;
scanf("%d", &size);
int arr[size];
for(i=1; i<=size; i++)
{
scanf("%d", arr[i]);
printf("%d", arr[i]);
}
}
Which of the following statements are correct about the program below?
#include<stdio.h>
void main()
{
int size, i;
scanf("%d", &size);
int arr[size];
for(i=1; i<=size; i++)
{
scanf("%d", arr[i]);
printf("%d", arr[i]);
}
}
What will be the output of the following code?
void main()
{
int a[10];
printf("%d %d", a[-1], a[12]);
}
What will be the output of the following code?
void main()
{
int a[10];
printf("%d %d", a[-1], a[12]);
}
Size of the array need not be specified, when
Size of the array need not be specified, when
What will be the output of the program ?
#include<stdio.h>
int main()
{
int arr[1] = {10};
printf("%d", 0[arr]);
return 0;
}
What will be the output of the program ?
#include<stdio.h>
int main()
{
int arr[1] = {10};
printf("%d", 0[arr]);
return 0;
}
String concatenation means -
String concatenation means -
Which of the following is correct way to define the function fun() in the below program?
#include<stdio.h>
void main()
{
int a[3][4];
fun(a);
}
Which of the following is correct way to define the function fun() in the below program?
#include<stdio.h>
void main()
{
int a[3][4];
fun(a);
}
What will be the output of the program ?
#include
void main()
{
float arr[] = {12.4, 2.3, 4.5, 6.7};
printf("%d", sizeof(arr)/sizeof(arr[0]));
}
What will be the output of the program ?
#include
void main()
{
float arr[] = {12.4, 2.3, 4.5, 6.7};
printf("%d", sizeof(arr)/sizeof(arr[0]));
}
Which of the following function is used to find the first occurrence of a given string in another string?
Which of the following function is used to find the first occurrence of a given string in another string?
What will be the correct output of the following program?
#include<string.h>
void main()
{
char str[] = "C EXAMINATION", rev[17];
int i = strlen(str), j=0;
for( ; i>=0; rev[j++] = str[i--]);
rev[j] = '�';
puts(rev);
}
What will be the correct output of the following program?
#include<string.h>
void main()
{
char str[] = "C EXAMINATION", rev[17];
int i = strlen(str), j=0;
for( ; i>=0; rev[j++] = str[i--]);
rev[j] = '�';
puts(rev);
}
Consider the following type definition.
typedef char x[10];
x myArray[5];
What will sizeof(myArray) be ? (Assume one character occupies 1 byte)
Consider the following type definition.
typedef char x[10];
x myArray[5];
What will sizeof(myArray) be ? (Assume one character occupies 1 byte)
What is right way to Initialize array?
What is right way to Initialize array?
-
-
-
-