Q.1.

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}
Q.2.

Which of the following statements are FALSE about the below code?

int main(int ac, char *av[])
{
}
Q.3.

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}
Q.4.

What will be the output of the program (sample.c) given below if it is executed from the command line?
cmd> sample friday tuesday sunday

/* sample.c */
#include<stdio.h>

int main(int argc, char *argv[])
{
    printf("%c", *++argv[);
    return}
Q.5.

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>        printf("%s", *++argv);
    return}
Q.6.

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[+ argv[+ argv[3];
    printf("%d", j);
    return}
Q.7.

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=    i+=strlen(argv[1]);
    while(i>    {
        printf("%c", argv[1][--i]);
    }
    return}
Q.8.

What will be the output of the program (myprog.c) given below if it is executed from the command line?
cmd> myprog30

/* myprog.c */
#include<stdio.h>

int main(int argc, char **argv)
{
    int i;
    for(i=i<argc; i++)
        printf("%s\n", argv[i]);
    return}
Q.9.

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}
Q.10.

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}
Q.11.

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=i<argc; i++)
        printf("%c", argv[i][0]);
    return}
Q.12.

What will be the output of the program

#include<stdio.h>
void fun(int);

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