Discover the depth  of  C

  C C++  Linux ProgrammingNEW   Operating Systems  Data StructuresNEW  Compilers  Contact Us

Navigation

Join C4SwimmersGroup

 sitepromotion.gif (577 bytes) New Member

Test Your C/C++ Skills

  Playing with printf

  Playing with scanf

  Branching & Loops

  Functions

  Pointers Part I

  Pointers Part II

  Structure & Union

C Special

  Discovering C
  Exploring C Part I
  Exploring C Part II
  IFAQs

Programming Problems

  Part I
  Part II
 post-question_icon.gif (1062 bytes) Useful C/C++ Links
Downloads
C4S - Solution Pack
Data Structures
C++ & 8086 ALP
ADA & System S/w
Online Certifications
premiumservices.gif (1070 bytes) Brainbench
premiumservices.gif (1070 bytes) Benchmarks Global
Help and Support
customer_care_small.gif (1018 bytes) Suggestions
post-question_icon.gif (1062 bytes) Contribute
premiumservices.gif (1070 bytes) Feedback
premiumservices.gif (1070 bytes) Advertise with us
 

 memberhome.gif (1052 bytes) -Home Page-

 
 
.  

C For Swimmers : Mastering C step-by-step

Google


WWW c4swimmers.esmartguy.com
NOTE : It is assumed that -

Necessary header files are included
Programs/Snippets are tested under Linux as well as Windows platform
Programs/Snippets are compiled using VC++ 6.0 as well as gcc 3.2
The underlying machine is an x86 system

Weekly Queries : Week 2 : July 2005

 [Q001] What will be the output of the following program :
 int main()
 {
    char x[]="\0";
    if (printf("%s",x))
       printf("Ok here.");
    else
       printf("Forget it.");
    return 0;
 }
 (a)Ok here.
 (b)Compile-Time Error
 (c)Forget it.
 (d)None of these
 [Q002] What will be the output of the following program :
 int main()
 {
   char str1[]='H',str2[]="Mr.";
   printf("%s%s",str2,str1);
   return 0;
 }
 (a)XMr.
 (b)Compile-Time Error
 (c)Mr.X
 (d)None of these
 [Q003] What will be the output of the following program :
 #define prod(a,b) a*b
 int main() 
 {
    int x=5,y=6;
    printf("%d",prod(x+2,y-1));
    return 0;
 }
 (a)Compile-Time Error
 (b)35
 (c)16
 (d)None of these
 [Q004]  What will be the output of the following program :
 int main() 
 {
    short int i=32000;
    while (i++!=0);
    printf("%d",i);
    return 0;
 }
 (a)1
 (b)Infinitely
 (c)Compile-Time Error
 (d)None of these
 [Q005]  What will be the output of the following program :
 #ifdef something
    int some=0;
 #endif
 int main()
 {
    int thing = 0;
    printf("%d %d\n", some ,thing); 
    return 0;
 }
 (a)0 0
 (b)Compile-Time Error
 (c)None of these
 [Q006] What will be the output of the following program :
 #if something == 0
     int some=0;
 #endif

 int main()
 {
    int thing = 0;
    printf("%d %d\n", some ,thing);
    return 0;
 }
 (a)0 0
 (b)Compile-Time Error
 (c)None of these
 [Q007] Describe the following statement :
 void ( * abc( int, void ( *def) () ) ) ();
 [Q008] What will be the output of the following program :
 int main()
 {
    int i=11,j=21;
    i=i&=j&&21;
    printf("%d %d",i,j);
    return 0;
 }
 (a)11 21
 (b)1 21
 (c)Compile-Time Error
 (d)None of these
 [Q009] What will be the output of the following program :
 int main()
 {
    int i=4,j=7;
    j = j || i++;
    printf("%d %d", i, j);
    return 0;
 }
 (a)4 7
 (b)5 7
 (c)4 1 
 (d)5 1 
 (e)None of these
 [Q010] What will be the output of the following program :
 int DIM(int array[]) 
 {
     return sizeof(array)/sizeof(int );
 }
 int main()
 {
     int arr[10];
     printf("The dimension of the array is %d", DIM(arr)); 
     return 0; 
 }
 (a)The dimension of the array is 10
 (b)The dimension of the array is 1

 (c)Compile-Time Error
 (d)None of these

Send your feedback about Weekly queries - Week2 - July 2005 section to nandakishorkn@rediffmail.com

You are Visitor No.

Sign my Guestbook View my Guestbook


Subscribe to C4Swimmers Group
Designed and Maintained by  Nanda Kishor

Make money from your website

Thanks for using C For Swimmers.
Regarding this material, you can send Bug Reports, Suggestions, Comments, etc. to

nandakishorkn@rediffmail.com

TheFreeSite.com!

Note: All logos or trademarks are related to their respective owners.

Although every precaution has been taken, the designer(s) owe no responsibility for malicious errors.

No liability assumed for damages resulting from the use of the available information.