C Programming - 2
Description: THIS IS A TEST FOR PRACTISE THE OUTPUT AND SPECIAL FEATURES OF C | |
Number of Questions: 50 | |
Created by: Adhira Saini | |
Tags: C PROGRAMMING Programming Fundamentals of Computer Programming Computer Basics Integration by Parts Indefinite Integration Integration by Substitution Integration of Special Functions In-Definite Integration |
What is the value of variable POLYGON?
main()
{
int POLYGON, L, B; L=B =2; POLYGON = (L==B) ? 1 : 0;
}
If ASCII value of 'x' is 120. What is the value of i = ('x' - 'w')/3?
What will be the value of sum after the following program is executed? main() { int sum, index; sum = 1; index = 9; do { index = index - 1; sum = 2*sum; } while(index >9);
How many times will the following loop be executed if the input data item is 01234? while( c = getchar() ! = 0) {
What is the final value of digit? main() { int digit; for(digit = 0 ; digit <=9; ++digit) printf(“%d ”,digit); digit = 2*digit; --digit; }
The library function sqrt operates on a double precision argument. If i is an integer variable, which one of the following calls would correctly compute sqrt(i)?
If a = 0x6db7 and b = 0xa726, what is the value of a ^ b?
If a = 0x6db7 and b = 0xa726, then what is the value of a & b?
What would be the output of the follwing program? sum = 0; for(i=1;i<10;i++) if(i%2==0) sum +=i; printf(“%d”, sum);
If a = -11 & b = -3, what is the value of a % b?
Suppose i =7, f = 5.5 and c = 'W', what is the value of the given expression? (c ! = 'p' || i+f <=10)
Suppose i, j and k are integer variables with values 1, 2, 3 respectively, what is the value of the following expression?!((j+k) > (i+5))
The ''puts(argv[0]);'' prints
If n = 10, then the statement arr[++n] = n++ assigns
Consider the following program fragment. main() { int a,b,c; b=2 ; a= 2*(b++); c = 2*(++b); } Which one of the following is correct?
What will be the value of i? int i = 1; i = i +2*i ++; printf(“%d”,i);
The expression ''4 + 6/3 * 2 - 2 + 7 %3'' is equal to
What will be the value of y in the following program fragment? int y = 10; If(y++ >9 && y++! = 10 && y++>10)
printf( “ab”, “cd”, “ef”); prints
The following program fragment prints int a= 5 , b=2; printf(“%d” , a+++++b);
The following program results in main() { printf(“%u”, main); }
Consider the following declaration. int a = 5, *b = &a; printf(“%d”, a*b);The above program prints
If 7 bits are used to store a character, the percentage reduction of needed storage will be
Consider the declaration. int a = 5, b = &a; printf(“%d”, a*b); prints
The following program prints main() { int i = 5; i = (++i) / (i ++); printf(“%d”,i); }
Directions: Answer the following question, based on the following declaration. struct { char city[10]; char street[20]; int pincode; } addr; struct { char name[20]; int sex ; addr locate; } criminal,*kd = &criminal;
The third character in the criminal name can be accessed by
The statement fseek(fp,0L,0) means
Directions: Answer the following question based on the following declaration. struct { char city[10]; char street[20]; int pincode; } addr; struct { char name[20]; int sex ; addr locate; } criminal,*kd = &criminal;
*(kd ->name + 2) can be used instead of
The following declaration means int x : 4;
The most significant bit will be lost in
The declaration enum cities { bethlehem, jericho, nazareth = 1, jerusalem } assign(s) the value 1 to
The output of the following program will be main() { int a = 1, b=2, c=3; printf(“%d”, a+=(a+=3,5,a)); }
Directions: Answer the following question based on the following declaration. struct { char city[10]; char street[20]; int pincode; } addr; struct { char name[20]; int sex ; addr locate; } criminal,*kd = &criminal;
The pincode can be accessed by
If one wants to retain certain bits and set the rest from a given bit pattern, the correct masking operation is
The following statements find the
define hypotenuse(a, b) sqrt( a*a + b*b);
the macro call hypotenuse (a+2,b+3);
If the word size is 16 bit, ~0xc5 will be
Directions: Answer the following question, based on the following declaration struct { char city[10]; char street[20]; int pincode; } addr; struct { char name[20]; int sex ; addr locate; } criminal,*kd = &criminal;
The 'sex' can be accessed by
The program main() { float b = 0.7; printf(“%d, %f”,b,b); } prints
In a certain machine, the sum of an integer and its 1's complement is 220-1. What is the size of (int), in bits?
Lint is
What is the output of the following 'C' program? main() { printf(“ %x”,-1 >>4); }
The statement printf (“%d”, sizeof(“”)); prints
If y is of integer type, the expressions 3*(y-8)/9 and (y-8)/9*3 yield the same result if
What header file should be included if you are to develop a function that can accept variable no. of arguments?
In C language, x = x-y+1; means
What does the statement printf(“%d”,10?0?5:11:12); print?
The rule for implicit type conversion in 'C' is
What does the following C statement print? print(“%d”, ++5);
What is the output of following 'C' fragment? For(i=1,j=10;i<6;++i,--j) printf(“%d%d”,i,j);
Recursive functions are executed in a