Monday 8 September 2008

C Command line argument questions with solution




Command line arguments in c example 



(1)What will be output of
following c code?




#include

int main(int count,char *argv[]){

    int i=0;

    for(i=0;i
         printf("\n%s",argv[i]);

    return 0;

}



//save file as arg.c

In command line

C:\tc\bin>arg c question bank

Output:

c

question

bank








(2) What will be output of
following c code?



#

Tuesday 2 September 2008

Hexadecimal number questions with solutions in c program








(8) What will be output:void main(){char a='\x82';clrscr();printf("%d",a);getch();}Output:-126Explanation: \x symbol indicate the hexadecimal number system in character

Typedef keyword with example








What will be output of following program?void main(){typedef unsigned long int world;world a=45;printf(“%d”,a);}Output : 45