In C/C++ programming, the escape sequence "\a" is used for:
Which of the following data types is a collection of different data types?
What would be the output of the following C program?
int main()
{
printf("%d %d %d", sizeof(3.14f), sizeof(3.14), sizeof(3.141));
}
What are the values of d in the following code?
main()
{
int a=3, b=2, c=1, d;
d=a|b&c;
printf("d=%d\n",d);
d=a|b&~c;
printf("d=%d\n",d);
}
What is the output of the following program?
int main()
{
int x[3]={1,2,3};
int i;
for (i=0;i<5;i++)
cin<<x[i]<<" ";
Which of the following statements about input iterators is correct?
What is the output of the following program?
void scope();
int main()
{
int k = 11;
int l = 22;
printf("%d %d", l, k);
scope();
printf("%d %d", k, l);
}
void scope()
{
int k = 111;
int l = 222;
printf("%d %d", l, k);
}
What is the output of the following C++ code?
#include <iostream>
using namespace std;
int main()
{
for(int i=1; i<4; i++)
{
for(int j=1; j<=i; j++)
{
if((i+j)%2==0)
cout<<"1";
else
cout<<"0";
}
cout<<" ";
}
return 0;
}
What happens if the following program is compiled in both C and C++?
#include<stdio.h>
struct STRUCT
{
int static a;
};
int main()
{
struct STRUCT s;
return 0;
}
Consider the following snippet of a C program. Assume that swap(&x, &y) exchanges the contents of x and y.
int main() { int array[] = {3, 5, 1, 4, 6, 2}; int done = 0; int i; while (done == 0) { done = 1; for (i = 0; i <= 4; i++) { if (array[i] < array[i+1]) { swap(&array[i], &array[i+1]); done = 0; } } for (i = 5; i >= 1; i--) { if (array[i] > array[i-1]) { swap(&array[i], &array[i-1]); done = 0; } } } printf("%d", array[3]); }
The output of the program is
OnSite
1 Openings
FullTime
Posted 17 days ago