Posts

datatypess

What will be output when you will execute following c code? #include <stdio.h> int  main(){     printf( "%d\t" , sizeof (6.5));     printf( "%d\t" , sizeof (90000));     printf( "%d" , sizeof ( 'A' ));      return  0; } Choose all that apply: (A)  4 2 1 (B) 8 2 1  (C) 4 4 1 (D) 8 4 1 (E) 8 4 2 Explanation: Turbo C++ 3.0:  8 4 2 Turbo C ++4.5:  8 4 2 Linux GCC:  8 4 4 Visual C++: 8 4 4 By default data type of numeric constants is: 6.5 :  double 90000: long int ‘A’: char In C size of data type varies from compiler to compiler. In TURBO C 3.0 (16 bit compilers) size of: double is 8 byte Long int is 4 byte Character constant is 2 byte   (size of char data type is one byte) In TURBO C 4.5 or Linux GCC compilers (32 bit compilers) size of: double is 8 byte long int is 8 byte Character constant is 2 byte  

Algebra

1. If n is the sum of two consecutive odd integers and less than 100, what is the greatest possibility of n? Solution: Taking greatest possibility we take 51 + 49 but 51 + 49 = 100,  we need x + y < 100 so we take  47 + 49 = 96 2.  If the roots of the equation (x + 1) (x + 9) + 8 = 0 are a and b, then the roots of the equation (x + a) (x + b) - 8 = 0 are Solution: (x + 1) (x + 9) + 8 = 0  => (x^2) + 10x + 17 = 0  Hence a+b = -10 and ab=17 (x + a) (x + b) - 8 = 0  => (x^2) + (a+b)x + ab - 8 = 0  (x^2) + 10x + 17 - 8 = 0  => x = 1,9 3. If F(X) = AF(X)4 + B(X)2 + X + 5 , F(– 3) = 2, then F(3) = ? Solution: f(-3)=af(-3)4+bf(-3)+(-3)+5 2=a*2*4+b*2+2 8a+4b=0 f(3)=af(3)4+bf(3)2+3+5 f(3)[1-4a-2b]=_8 multiply by 2 both sides f(3)[2-(8a+4b)]=16 f(3)=8 (or) 81a+9b-3+5=2 =>81a+9b+5=5 now f(3) 81a+9b+3+5 =5+3=8 4.  4^2 + 2* 5^2 + 3* 6^2 +4* 7^2+...........+27*30^2 ? Solution: ∑ r^2 = n(n+1)(2n+1)/6 ∑ r^3 = [n(n+1)/2] ∴ 4^2+(5^3+6^3+

Area & volume

1. T he two sides of a triangle are 32 and 68. the area is 960 sq.cm. find the third side of triangle Solution: we see 68^2-32^2 =(68+32)*(68-32) =100*36=60^2 now (1/2)*60*32 =960(match with given options) (i.e area of a right angled triangle whose sides are 32,60,68) third side= 60 2.  Smita was making a cube with dimensions 5*5*5 using 1*1*1 cubes. What is the number of cubes needed to make a hollow cube looking of the same shape? Solution:  first are so (5*5*5)=125 then to make hollow cube v muz take out the outr most cubes  so 5-2 and 5-2 and 5-2 so 125-[(5-2)*(5-2)*(5-2)]  = 98 3. Arun makes a popular brand of icecream in a rectangular shaped bar 6cm long, 5cm wide and 4cm thick. To cut costs,the comapny had decided to reduce the volume of bar by19%. The thickness will remain the same, but the length and width will be decreased by the same percentage. the new width will be? Solution: volume=l*b*h =6*5*2 =60cm^3 volume is reduced by 19% new volume =(100-