11 Mar 2015

Basic level c practice function set1




2.      main()

{

clrscr();

}

clrscr();

           

Answer:

No output/error

Explanation:

The first clrscr() occurs inside a function. So it becomes a function call. In the second clrscr(); is a function declaration (because it is not inside any function).


3.      main()

            {

            char name[10],s[12];

            scanf(" \"%[^\"]\"",s);

            }

            How scanf will execute?

Answer:

First it checks for the leading white space and discards it.Then it matches with a quotation mark and then it  reads all character upto another quotation mark.


1 comment:

  1. Nice post about finding the square root of any number in the shortcut method. This will be helpful in exams for latest govt jobs

    ReplyDelete