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: For some days the new professor lectured above the heads of his pupils.

A over the head of

B on the heads of

C over the heads of

D No correction required

E through the heds of

Q2:
Point out the error in the following program.
#include<stdio.h>
struct emp
{
    char name[20];
    int age;
};
int main()
{
    emp int xx;
    int a;
    printf('%d\n', &a);
    return 0;
}

A
Error: in emp int xx;

B No error.

C None of these.

D
Error: in printf

Q3: According to ANSI specifications which is the correct way of declaring main when it receives command-line arguments?

A
int main(argc, argv)
int argc; char *argv;

B
int main(int argc, char *argv[])

C None of above

D
int main()
{
    int argc; char *argv;
}

Q4: What do the 'c' and 'v' in argv stands for?

A 'c' means argument control 'v' means argument vector

B 'c' means argument count 'v' means argument vertex

C 'c' means argument configuration 'v' means argument visibility

D 'c' means argument count 'v' means argument vector

Q5: 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)
{
    printf('%c\n', **++argv);
    return 0;
}

A o

B myprog one two three

C two

D myprog one

Q6: 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>
#include<stdlib.h>

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

A one

B two

C myprog

D three

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

int main(int argc, char *argv[])
{
    int j;
    j = argv[1] + argv[2] + argv[3];
    printf('%d', j);
    return 0;
}

A sample 6

B Error

C Garbage value

D 6

Q8:
What will be the output of the program (sample.c) given below if it is executed from the command line (turbo c under DOS)?
cmd> sample Good Morning
/* sample.c */
#include<stdio.h>

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

A Good Morning

B 3 Morning

C 2 Good

D 3 Good

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

int main(int argc)
{
    printf('%d ', argc);
    fun(argc);
    return 0;
}
void fun(int i)
{
    if(i!=4)
        main(++i);
}

A 1 2 3 4

B 2 3 4

C 1 2 3

D 1

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

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

A List of all files and folders in the current directory

B "*.c"

C sample *.c

D *.c