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 accused now flatly denies have admitted his guilt in his first statement.

A have been admitting

B No correction required

C having admitted

D had admitted

E has admitting

Q2:
Which of the following is correct about err used in the declaration given below?
 typedef enum error { warning, test, exception } err;

A The statement is erroneous.

B It is a structure.

C
It is a typedef for enum error.

D
It is a variable of type enum error.

Q3: What will be the output of the program (myprog.c) given below if it is executed from the command line?
cmd> myprog friday tuesday sunday
/* myprog.c */
#include<stdio.h>

int main(int argc, char *argv[])
{
    printf('%c', *++argv[1]);
    return 0;
}

A y

B r

C f

D m

Q4: What will be the output of the program (sample.c) given below if it is executed from the command line?
cmd> sample one two three
/* sample.c */
#include<stdio.h>

int main(int argc, char *argv[])
{
    int i=0;
    i+=strlen(argv[1]);
    while(i>0)
    {
        printf('%c', argv[1][--i]);
    }
    return 0;
}

A three two one

B eerht

C owt

D eno

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

int main(int argc, char *argv, char *env[])
{
    int i;
    for(i=1; i<argc; i++)
        printf('%s\n', env[i]);
    return 0;
}

A Error: cannot have more than two arguments in main()

B List of all command-line arguments

C count of command-line arguments

D List of all environment variables

Q6: What will be the output of the program (sample.c) given below if it is executed from the command line?
cmd> sample Jan Feb Mar
/* sample.c */
#include<stdio.h>
#include<dos.h>

int main(int arc, char *arv[])
{
    int i;
    for(i=1; i<_argc; i++)
        printf('%s ', _argv[i]);
    return 0;
}

A sample Jan Feb Mar

B No output

C Jan Feb Mar

D Error

Q7: What will be the output of the program (sample.c) given below if it is executed from the command line?
cmd> sample monday tuesday wednesday thursday
/* sample.c */
#include<stdio.h>

int main(int argc, char *argv[])
{
    while(--argc>0)
        printf('%s', *++argv);
    return 0;
}

A tuesday

B monday tuesday wednesday thursday

C monday tuesday thursday

D sample monday tuesday wednesday thursday

Q8: If the following program (myproc.c) is present in the directory 'C:\TC' then what will be output of the program if run it from DOS shell?
/* myproc.c */
#include<stdio.h>

int main(int argc, char *argv[])
{
    printf('%s', argv[0]);
    return 0;
}

A C:\TC

B SAMPLE.C

C Error

D C:\TC\MYPROC.EXE

Q9: What will be the output of the program (myprog.c) given below if it is executed from the command line?
cmd> myprog one two three
/* myprog.c */
#include<stdio.h>

int main(int argc, char *argv[])
{
    int i;
    for(i=1; i<argc; i++)
        printf('%c', argv[i][0]);
    return 0;
}

A nwh

B eoe

C ott

D oot

Q10: What will be the output of the program (sample.c) given below if it is executed from the command line?
cmd> sample 1 2 3
cmd> sample 2 2 3
cmd> sample 3 2 3
/* sample.c */
#include<stdio.h>

int main(int argc, char *argv[])
{
    printf('%s\n', argv[0]);
    return 0;
}

A sample 3 2 3

B sample 1 2 3

C sample

D Error