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 had admitted

B No correction required

C having admitted

D has admitting

E have been admitting

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

A
It is a variable of type enum error.

B The statement is erroneous.

C It is a structure.

D
It is a typedef for 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 r

B y

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 owt

B eno

C three two one

D eerht

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 List of all environment variables

B count of command-line arguments

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

D List of all command-line arguments

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 Jan Feb Mar

B sample Jan Feb Mar

C No output

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 thursday

C monday tuesday wednesday 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 SAMPLE.C

B C:\TC

C C:\TC\MYPROC.EXE

D Error

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 Error

B sample

C sample 3 2 3

D sample 1 2 3