What symbol is used to left-justify the data within the given field width?
The process of inserting an element into a stack is called ____________
What is the output of the following C code?
Which C++ function allows you to set a minimum width for the next input?
What is the output of the following code snippet?
#include<stdio.h>
main()
{
int x = 5;
if(x=5)
{
if(x=5) break;
printf("Hello");
}
printf("Hi");
}
What will be the output of the following C++ code?
#include<iostream>
using namespace std;
int main()
{
for (;;);
{
cout<<"Hello";
}
return 0;
}
What is the meaning of the following C declaration?
int(*p[5])();
What will be the output of the following C++ code?
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
void func(const int &a)
{
int temp = 10;
a = temp;
cout<<a;
}
int main(int argc, char const *argv[])
{
int a = 5;
func(a);
return 0;
}
#include <bits/stdc++.h>
using namespace std;
class increment
{
private:
int num;
public:
increment(int n) : num(n) { }
int operator () (int arr_num) const {
return num + arr_num;
}
};
int main()
{
int arr[] = {1, 2, 3, 4, 5};
int n = sizeof(arr)/sizeof(arr[0]);
int to_add = 5;
transform(arr, arr+n, arr, increment(to_add));
for (int i=0; i<n; i++)
cout << arr[i] ;
}
Let A be a square matrix of size n x n. Consider the following program. What is the expected output?
C = 100
for i = 1 to n do
for j = 1 to n do
{
Temp = A[i][j] + C
A[i][j] = A[j][i]
A[j][i] = Temp - C
}
for i = 1 to n do
for j = 1 to n do
Output(A[i][j]);