image not found

Oops! That page can't be found.


Directions to Solve

Which of phrases given below each sentence should replace the phrase printed in bold type to make the grammatically correct? If the sentence is correct as it is, mark 'E' as the answer.

Q1: He never has and ever will take such strong measures.

A has and never will take

B had taken nor will ever take

C No correction required

D had and ever will take

E had taken and will ever take

Q2: Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1 ?

A rem = 3.14 % 2.1;

B Remainder cannot be obtain in floating point division.

C rem = fmod(3.14, 2.1);

D rem = modf(3.14, 2.1);

Q3: What will be the output of the program?
#include<stdio.h>
int fun(int(*)());

int main()
{
    fun(main);
    printf("Hi\n");
    return 0;
}
int fun(int (*p)())
{
    printf("Hello ");
    return 0;
}

A Error

B Infinite loop

C Hello Hi

D Hi

Q4: What will be the output of the program?
#include<stdio.h>

int fun(int i)
{
    i++;
    return i;
}

int main()
{
    int fun(int);
    int i=3;
    fun(i=fun(fun(i)));
    printf("%d\n", i);
    return 0;
}

A Error

B 4

C Garbage value

D 5

Q5: What will be the output of the program?
#include<stdio.h>
int fun(int);
int main()
{
    float k=3;
    fun(k=fun(fun(k)));
    printf("%f\n", k);
    return 0;
}
int fun(int i)
{
    i++;
    return i;
}

A 3.000000

B 5.000000

C Garbage value

D 4.000000

Q6: What will be the output of the program?
#include<stdio.h>
#include<stdlib.h>

int main()
{
    int i=0;
    i++;
    if(i<=5)
    {
        printf("AptitudeCrack");
        exit(1);
        main();
    }
    return 0;
}

A Prints "AptitudeCrack"

B Prints "AptitudeCrack" 5 times

C Infinite loop

D Function main() doesn't calls itself

Q7: Point out the error in the program

f(int a, int b)
{
    int a;
    a = 20;
    return a;
}

A Missing parenthesis in return statement

B None of above

C Redeclaration of a

D The function should be defined as int f(int a, int b)

Q8: Point out the error in the program
#include<stdio.h>
int f(int a)
{
  a > 20? return(10): return(20);
}
int main()
{
    int f(int);
    int b;
    b = f(20);
    printf("%d\n", b);
    return 0;
}

A Error: Prototype declaration

B No error

C Error: return statement cannot be used with conditional operators

D None of above

Q9: Point out the error in the program
#include<stdio.h>

int main()
{
    int a=10;
    void f();
    a = f();
    printf("%d\n", a);
    return 0;
}
void f()
{
    printf("Hi");
}

A Error: Not allowed assignment

B Error: Doesn't print anything

C None of above

D No error

Q10: Which of the following statements are correct about the program?
#include<stdio.h>

int main()
{
    printf("%p\n", main());
    return 0;
}

A It prints garbage values infinitely

B No Error and print nothing

C Runs infinitely without printing anything

D Error: main() cannot be called inside printf()