Q161
Open question#include <stdio.h>
int main(int argc, char *argv[])
{
printf("%d\n", argc);
return 0;
}Select an option to see the answer and solution.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
253
Questions
9/13
Page
Pick an option on a question to see the right answer and solution.
Q161
Open question#include <stdio.h>
int main(int argc, char *argv[])
{
printf("%d\n", argc);
return 0;
}Select an option to see the answer and solution.
Q162
Open questionconst int *ptr;Select an option to see the answer and solution.
Q163
Open question#include <stdio.h>
void main()
{
char a[10][5] = {"hi", "hello", "fellows"};
printf("%p\n", a);
printf("%p", a[0]);
}Select an option to see the answer and solution.
Q164
Open question#include <stdio.h>
void main()
{
char *a[10] = {"hi", "hello", "how"};
printf("%d\n", sizeof(a[1]));
}Select an option to see the answer and solution.
Q165
Open question#include <stdio.h>
void f(int a[2][])
{
a[0][1] = 3;
int i = 0, j = 0;
for (i = 0;i < 2; i++)
for (j = 0;j < 3; j++)
printf("%d", a[i][j]);
}
void main()
{
int a[2][3] = {0};
f(a);
}Select an option to see the answer and solution.
Q166
Open question#include <stdio.h>
int mul(int a, int b, int c)
{
return a * b * c;
}
void main()
{
int *function_pointer;
function_pointer = mul;
printf("The product of three numbers is:%d",
function_pointer(2, 3, 4));
}Select an option to see the answer and solution.
Q167
Open question#include <stdio.h>
int main()
{
int ary[4] = {1, 2, 3, 4};
int *p = ary + 3;
printf("%d\n", p[-2]);
}Select an option to see the answer and solution.
Q168
Open question#include <stdio.h>
int x = 0;
void main()
{
int *ptr = &x;
printf("%p\n", ptr);
x++;
printf("%p\n ", ptr);
}Select an option to see the answer and solution.
Q169
Open questionSelect an option to see the answer and solution.
Q170
Open question#include <stdio.h>
struct student
{
int no = 5;
char name[20];
};
void main()
{
struct student s;
s.no = 8;
printf("hello");
}Select an option to see the answer and solution.
Q171
Open questionSelect an option to see the answer and solution.
Q172
Open question#include <stdio.h>
void first()
{
printf("Hello World");
}
void main()
{
void *ptr() = first;
ptr++
ptr();
}Select an option to see the answer and solution.
Q173
Open questionSelect an option to see the answer and solution.
Q174
Open question#include <stdio.h>
int main()
{
char a[1][5] = {"hello"};
printf("%s", a[0]);
return 0;
}Select an option to see the answer and solution.
Q175
Open question#include <stdio.h>
void main()
{
char *s = "hello";
char *p = s;
printf("%p\t%p", p, s);
}Select an option to see the answer and solution.
Q176
Open question#include <stdio.h>
int main()
{
char *str = "hello world";
char strary[] = "hello world";
printf("%d %d\n", strlen(str), strlen(strary));
return 0;
}Select an option to see the answer and solution.
Q177
Open question#include <stdio.h>
int main()
{
char *str = "hello, world!!\n";
char strc[] = "good morning\n";
strcpy(strc, str);
printf("%s\n", strc);
return 0;
}Select an option to see the answer and solution.
Q178
Open questionSelect an option to see the answer and solution.
Q179
Open questionSelect an option to see the answer and solution.
Q180
Open question#include <stdio.h>
int main()
{
void *p;
int a[4] = {1, 2, 3, 4};
p = &a[3];
int *ptr = &a[2];
int n = (int*)p - ptr;
printf("%d\n", n);
}Select an option to see the answer and solution.