General Knowledge :: Testing sawaal
-
Which of the following statement is true?
-
What will be output of the following c program ?
#include
int main()
{
int max-val=100;
int min-val=10;
int avg-val;
avg-val =( max-val + min-val ) / 2;
printf( "%d", avg-val );
return 0;
}
-
What will be output when you will execute following c code?
#include <stdio.h>
void main(){
int const SIZE = 5;
int expr;
double value[SIZE] = { 2.0, 4.0, 6.0, 8.0, 10.0 };
expr=1|2|3|4;
printf ( "%f", value[expr] );
} -
Which Of The Following Statements Is Most Accurate For The Declaration X = Circle()?
-
What will be output of following program ?
#include
int main(){
int a = 10;
void *p = &a;
int *ptr = p;
printf("%u",*ptr);
return 0;}
-
What would be the output of the following program ?
main()
{
const int x = 5;
int *ptrx;
ptrx = &x;
*ptr = 10;
printf ("%d", x);
}
-
What will output when you compile and run the following code?
#include <stdio.h>
struct student
{int roll;
int cgpa;
int sgpa[8];};
void main()
{struct student s = { 12,8,7,2,5,9 };
int *ptr;
ptr = (int *)&s;
clrscr();
printf( "%d", *(ptr+3) );
getch();}
-
What will be output when you will execute following c code?
#include <stdio.h>
void main(){
switch(2){
case 1L:printf("No");
case 2L:printf("%s","I");
goto Love;
case 3L:printf("Please");
case 4L:Love:printf("Hi");
}
} -
If the following program (myprog) is run from the command line as
myprog 1 2 3
what would be the output?
main(int argc, char *argv[])
{
int i, j = 0;
for (i = 0; i < argc ; i++)
j = j + atoi ( argv[i]);
printf ("%d", j);
}
-
What will be output of following program?
#include <stdio.h>
int main(){
void (*p)();
int (*q)();
int (*r)();
p = clrscr;
q = getch;
r = puts;
(*p)();
(*r)("www.sawaal.com");
(*q)();
return 0;
}
A.
Cohesion is the OO principle most closely associated with hiding implementation details
|
B.
Cohesion is the OO principle most closely associated with making sure that classes know about other classes only through their APIs
|
C.
Cohesion is the OO principle most closely associated with making sure that a class is designed with a single, well-focused purpose
|
D.
None
|