Q161
Open questionSelect an option to see the answer and solution.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
176
Questions
9/9
Page
Pick an option on a question to see the right answer and solution.
Q161
Open questionSelect an option to see the answer and solution.
Q162
Open question#include<iostream>
using namespace std;
int main()
{
int a, b, c, d;
cout<<”Enter the value of a, b, c, d: “;
cin>>a>>b>>c>>d;
int arr[a - b/c + d];
}Select an option to see the answer and solution.
Q163
Open questionSelect an option to see the answer and solution.
Q164
Open questionSelect an option to see the answer and solution.
Q165
Open questionSelect an option to see the answer and solution.
Q166
Open questionSelect an option to see the answer and solution.
Q167
Open question#include <iostream>
using namespace std;
int main()
{
int arr[] = {1,2,3,4,5,6};
int n = sizeof(arr)/sizeof(arr[0]);
int d=4;
int temp[10];
for(int i=0;i<d;i++)
temp[i]=arr[i];
int j=0;
for(int i=d;i<n;i++,j++)
arr[j]=arr[i];
int k=0;
for(int i=n-d;i<n;i++,k++)
arr[i]=temp[k];
for(int i=0;i<n;i++)
cout<<arr[i]<<" ";
return 0;
}Select an option to see the answer and solution.
Q168
Open questionSelect an option to see the answer and solution.
Q169
Open questionSelect an option to see the answer and solution.
Q170
Open questionSelect an option to see the answer and solution.
Q171
Open questionSelect an option to see the answer and solution.
Q172
Open questionSelect an option to see the answer and solution.
Q173
Open questionSelect an option to see the answer and solution.
Q174
Open question#include <bits/stdc++.h>
using namespace std;
void func(int a[], int n, int k)
{
if (k <= n)
{
for (int i = 0; i < k/2; i++)
swap(a[i], a[k-i-1]);
}
}
int main()
{
int a[] = {1, 2, 3, 4, 5};
int n = sizeof(a) / sizeof(int), k = 3;
func(a, n, k);
for (int i = 0; i < n; ++i)
cout << a[i]<<" ";
return 0;
}Select an option to see the answer and solution.
Q175
Open questionSelect an option to see the answer and solution.
Q176
Open questionSelect an option to see the answer and solution.