What is the purpose of the clog object in C++?
Which of the following features of OOP is not used in the given C++ code?
In a for loop with a multistatement loop body, semicolons should appear following:
What is the syntax of a class template?
How a reference is different from a pointer?
Choose the correct output for following code
#include<bits/stdc++.h>
using namespace std;
int main(){
string s="ABEKUS";
for(int i=0;i<s.size();i++){
s[i]+=32;
}
cout<<s;
return 0;
}
The output of the following C program is __________.
void f1 (int a, int b) { int c; c=a; a=b; b=c; } void f2 (int *a, int *b) { int c; c=*a; *a=*b;*b=c; } int main() { int a=4, b=5, c=6; f1(a, b); f2(&b, &c); printf (“%d”, c-a-b); return 0; }
Consider the following C code. Assume that unsigned long int type length is 64 bits.
unsigned long int fun(unsigned long int n) { unsigned long int i, j = 0, sum = 0; for( i = n; i > 1; i = i/2) j++; for( ; j > 1; j = j/2) sum++; return sum; }
The value returned when we call fun with the input 240 is
The following function computes the maximum value contained in an integer array p[] of size n (n >= 1)
int max(int *p, int n) { int a=0, b=n-1; while (__________) { if (p[a] <= p[b]) { a = a+1; } else { b = b-1; } } return p[a]; }
The missing loop condition is
What will be the output of the following C++ code?
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
int main(int argc, char const *argv[])
{
int a = 5;
int *p = &a;
int &q = a;
cout<<p<<endl;
cout<<q<<endl;
return 0;
}
OnSite
1 Openings
FullTime
Posted 17 days ago