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: The man who has committed such a serious crime must get the mostly severe punishment.

A be getting the mostly severely

B get the most severe

C have got the most severely

D have been getting the severe most

E No correction required

Q2: Which of the following function is more appropriate for reading in a multi-word string?

A scanf();

B puts();

C printf();

D gets();

Q3: Which of the following function is correct that finds the length of a string?

A
int xstrlen(char s)
{
    int length=0;
    while(*s!='\0')
        length++; s++;
    return (length);
}

B
int xstrlen(char *s)
{
    int length=0;
    while(*s!='\0')
        length++;
    return (length);
}

C
int xstrlen(char *s)
{
    int length=0;
    while(*s!='\0')
    {    length++; s++; }
    return (length);
}

D
int xstrlen(char *s)
{
    int length=0;
    while(*s!='\0')
        s++;
    return (length);
}

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

int main()
{
    char str1[20] = "Hello", str2[20] = " World";
    printf("%s\n", strcpy(str2, strcat(str1, str2)));
    return 0;
}

A Hello World

B WorldHello

C World

D Hello

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

int main()
{
    char p[] = "%d\n";
    p[1] = 'c';
    printf(p, 65);
    return 0;
}

A a

B c

C 65

D A

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

int main()
{
    printf("%d\n", strlen("123456"));
    return 0;
}

A 12

B 2

C 7

D 6

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

int main()
{
    printf(5+"Good Morning\n");
    return 0;
}

A M

B Good

C Good Morning

D Morning

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

int main()
{
    char str[] = "India\0\Aptitude\0";
    printf("%s\n", str);
    return 0;
}

A India

B India\0Aptitude

C Aptitude

D India Aptitude

Q9: What will be the output of the program If characters 'a', 'b' and 'c' enter are supplied as input?
#include<stdio.h>

int main()
{
    void fun();
    fun();
    printf("\n");
    return 0;
}
void fun()
{
    char c;
    if((c = getchar())!= '\n')
        fun();
    printf("%c", c);
}

A abc abc

B Infinite loop

C cba

D bca

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

int main()
{
    printf("India", "Aptitude\n");
    return 0;
}

A India Aptitude

B India

C Error

D Aptitude