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

B had admitted

C No correction required

D have been admitting

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
It is a typedef for enum error.

B It is a structure.

C The statement is erroneous.

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 f

B y

C m

D r

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 eerht

B three two one

C eno

D owt

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 count of command-line arguments

C List of all 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 Error

B Jan Feb Mar

C sample Jan Feb Mar

D No output

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 sample monday tuesday wednesday thursday

D 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\MYPROC.EXE

C C:\TC

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 oot

C eoe

D ott

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 Error

C sample

D sample 1 2 3