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   interview questions urls   External Links  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
write a C code 
to reverse a string using a recursive function, without 
swapping or using an extra memory.
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: write a C code to reverse a string using a recursive function, without swapping or using an extra memory.
Answer
# 1
void reverse(*str)
{
 if(*str)
 {
   reverse(str+1);
   putchar(*str);
 }
}
 
Is This Answer Correct ?    3 Yes 4 No
Sampath
 
  Re: write a C code to reverse a string using a recursive function, without swapping or using an extra memory.
Answer
# 2
void reverse(char s[],int len)
{
putchar(s[len]);
len--;
if(len>=0)
reverse(s,len);

return;
}
 
Is This Answer Correct ?    5 Yes 2 No
Valli
 
 
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
Main must be written as a.the first function in the program b.Second function in the program c.Last function in the program d.any where in the program TCS10
class foo { public: static int func(const char*& p) const; }; This is illegal, why? Google6
Find Error if any in below code, Justify ur answer: struct xx { int a; struct yy { char c; struct xx* p; } struct yy* q; } NDS2
what is diff between localstatic and globalstatis variable possible 2 use in another file...? HCL2
I have a function which accepts, and is supposed to initialize,a pointer, but the pointer in the caller remains unchanged.  1
which of the following statements is incorrect a.typedef struct new{ int n1; char n2; } DATA; b.typedef struct { int n3; char *n4; }ICE; c.typedef union { int n5; float n6; } UDT; d.#typedef union { int n7; float n8; } TUDAT; TCS5
how memory store byte Huawei3
proc() { static i=10; printf("%d",i); } If this proc() is called second time, what is the output? Hughes5
what are the various memory handling mechanisms in C ? HP2
WRITE A PROGRAM TO PRINT THE FOLLOWING OUTPUTS USING FOR LOOPS. A) * B) ***** *** * * ***** * * *****  2
what's the o/p int main(int n, char *argv[]) { char *s= *++argv; puts(s); exit(0); } Motorola1
compute the nth mumber in the fibonacci sequence? TCS6
What is the function of ceil(X) defined in math.h do? A)It returns the value rounded down to the next lower integer B)it returns the value rounded up to the next higher integer C)the Next Higher Value D)the next lower value Accenture3
How to receive strings with spaces in scanf()  3
pick out the odd one out of the following a.malloc() b.calloc() c.free() d.realloc() TCS1
Write a program that accepts a string where multiple spaces are given in between the words. Print the string ignoring the multiple spaces. Example: Input: “ We.....Are....Student “ Note: one .=1 Space Output: "We Are Student" IBM3
6)swap(int x,y) { int temp; temp=x; x=y; y=temp; } main() { int x=2;y=3; swap(x,y); } after calling swap ,what are yhe values x&y?  2
Write an implementation of “float stringToFloat(char *str).” The code should be simple, and not require more than the basic operators (if, for, math operators, etc.). • Assumptions • Don’t worry about overflow or underflow • Stop at the 1st invalid character and return the number you have converted till then, if the 1st character is invalid return 0 • Don’t worry about exponential (e.g. 1e10), instead you should treat ‘e’ as an invalid character • Write it like real code, e.g. do error checking • Go though the string only once • Examples • “1.23” should return 1.23 • “1a” should return 1 • “a”should return 0 Qualcomm2
What is the output for the program given below typedef enum grade{GOOD,BAD,WORST,}BAD; main() { BAD g1; g1=1; printf("%d",g1); } ADITI2
Here is alphabets : abcdefgh 1) how to reverse. as hgfedcba 2) after reversal, how to group them in a pair hg fe dc ba.  1
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

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