ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Code Snippets  >>  Programming Code  >>  C Code
 
 


 

 
 C Code interview questions  C Code Interview Questions
 C++ Code interview questions  C++ Code Interview Questions
 VC++ Code interview questions  VC++ Code Interview Questions
 Java Code interview questions  Java Code Interview Questions
 Dot Net Code interview questions  Dot Net Code Interview Questions
 Visual Basic Code interview questions  Visual Basic Code Interview Questions
 Programming Code AllOther interview questions  Programming Code AllOther Interview Questions
Question
Which version do you prefer of the following two,

      1) printf(“%s”,str); 	// or the more curt one

      2) printf(str);
 Question Submitted By :: Susie
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Which version do you prefer of the following two, 1) printf(“%s”,str); // or the more curt one 2) printf(str);
Answer
# 1
Answer :  & Explanation:

Prefer the first one. If the str contains any  format
characters like %d then it will result in a subtle bug.
 
Is This Answer Correct ?    0 Yes 0 No
Susie
 

 
 
 
Other C Code Interview Questions
 
  Question Asked @ Answers
 
main() { char a[4]="HELLO"; printf("%s",a); }  1
void main() { int i; char a[]="\0"; if(printf("%s\n",a)) printf("Ok here \n"); else printf("Forget it\n"); }  1
Write out a function that prints out all the permutations of a string. For example, abc would give you abc, acb, bac, bca, cab, cba. You can assume that all the characters will be unique. Microsoft4
#define int char main() { int i=65; printf("sizeof(i)=%d",sizeof(i)); }  1
void main() { static int i=i++, j=j++, k=k++; printf(“i = %d j = %d k = %d”, i, j, k); }  1
Declare an array of N pointers to functions returning pointers to functions returning pointers to characters?  1
void main() { int k=ret(sizeof(float)); printf("\n here value is %d",++k); } int ret(int ret) { ret += 2.5; return(ret); }  1
What is the hidden bug with the following statement? assert(val++ != 0);  1
Is the following code legal? typedef struct a aType; struct a { int x; aType *b; };  1
Derive expression for converting RGB color parameters to HSV values  1
plz send me all data structure related programs  2
#if something == 0 int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); }  1
void main() { int i=5; printf("%d",i++ + ++i); }  1
#include<conio.h> main() { int x,y=2,z,a; if(x=y%2) z=2; a=2; printf("%d %d ",z,x); }  1
What is the output for the following program main() { int arr2D[3][3]; printf("%d\n", ((arr2D==* arr2D)&&(* arr2D == arr2D[0])) ); }  1
#include <stdio.h> main() { char * str = "hello"; char * ptr = str; char least = 127; while (*ptr++) least = (*ptr<least ) ?*ptr :least; printf("%d",least); }  1
#include<stdio.h> main() { int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} }; int *p,*q; p=&a[2][2][2]; *q=***a; printf("%d..%d",*p,*q); }  1
Write a procedure to implement highlight as a blinking operation  1
main() { main(); }  1
how to return a multiple value from a function? Wipro5
 
For more C Code Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com