GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Tech FAQs  >  OOPS
Go To First  |  Previous Question  |  Next Question 
 OOPS  |  Question 127 of 255    Print  
Write programs for String Reversal & Palindrome check

  
Total Answers and Comments: 2 Last Update: November 16, 2008   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
November 15, 2007 09:10:17   #1  
poty Member Since: April 2006   Contribution: 4    

RE: Write programs for String Reversal & Palindrome c...

REVERSE A STRING

#include<stdio.h>
#include<string.h>
main()
{
 char str[50],revstr[50];
 int i=0,j=0;
 printf("Enter the string to be reversed : ");
 scanf("%s",str);
 for(i=strlen(str)-1;i>=0;i--)
 {
 revstr[j]=str[i];
 j++;
 }
 revstr[j]='';
 printf("Input String : %s",str);
 printf("nOutput String : %s",revstr);
 getch();
}


 
Is this answer useful? Yes | No
November 16, 2008 03:20:31   #2  
snrmukund Member Since: November 2008   Contribution: 1    

RE: Write programs for String Reversal & Palindrome check
main()
{
char str[10];
int i=0;
clrscr();
printf("Enter the name to be reversed :");
scanf("%s",&str);
for(i=strlen(str);i>=0;i--)
{
printf("%c",str[i]);
}
getch();
}

 
Is this answer useful? Yes | No

 Related Questions

Latest Answer : All the solutions above are reading the source code with the files concepts.find a solution where you do not have a source file to read the contents.There is a macro or an attiribute which tells the compiler the name of the program, function or the attribute. ...

Latest Answer : Hi, This is a typical example of reflection. If you are using .NET then use reflection for this purpose. In this case you create an object of a particular  type and the invoke methods at run time by passing function name. ...

Latest Answer : #include main(int argc, char *argv[]){  printf("Removing: %s...n", argv[0]);  remove(argv[0]);} ...

Latest Answer : You can write Multithreading application by using POSIX library of Linux ...

Latest Answer : typedef enum {read,blue,green}color; void main() { color a = 1;    // Error in C++} ...

Latest Answer : Yes . e.g. scanf ("%10s", str ); only 10 chars would be taken in ...

Latest Answer : *(*(*(*(a+i)+j)+k)+l) ...
Tags : Pointer

Latest Answer :  there is no way to process an entire string.it has to be done char by char ...

Latest Answer : There is no way you can compare the two structure variables.for Ex:stucture test a, b;     if (a == b)   // is wrong, we can't compair structure as whole.Instread, we should compare individual members of the structures. ...

Latest Answer : Use fread() and fwrite() ...


 Sponsored Links

 
Related Articles

OOPS Tutorials

Object oriented programming OOP is a computer science term used to characterize a programming language that began development in the 1960&rsquo; s The term object oriented programming&rsquo; was originally coined by Xerox PARC to designate a computer application that describes the methodol
 

C++ String Representation and Handling

C String Representation and Handling In this C tutorial you will learn about string representation and handling how is string represented end string notation initializing char array character representation string literals example programe to understand the character array concept and the accessing
 

JavaScript String Object

JavaScript String Object In this JavaScript tutorial you will learn about String Object purpose of string object in JavaScript purpose of string object indexof method lastIndexOf method and substring method along with syntax and example mosgoogle center Purpose of String Object in JavaScript The mai
 

Convert a String into an Integer

How to convert a string into an integer in C program? This is done by using the function named as atoi(). This function atoi() is present in the header file named as &lt;stdlib.h&gt;. When programmers use this function they must include the header file by the statement #include &lt;stdl
 

String handling functions

What is the string handling functions present in header file &lt;string.h&gt;? There are number of string handling functions present in string.h. In other words if a programmer uses any of the function present in string.h then they must include the header file as #include &lt;string.h&am
 

Convert a String into Long Value

What string function is used to convert a string into long value? This is done by using the function named as atol() . This function atol() is present in the header file named as &lt;stdlib.h&gt;.&nbsp;When programmers use this function they must include the header file by the statement
 

Base Address of the String

What happens when we try to change the value of base address of the string? The base address of the sting takes a special place in the context of strings. This is because suing this base address only the string gets identified. In other words the base address therefore takes the position of constant
 

Supply Chain Management Degree Programs

Supply Chain Management Degree Programs What a Supply Chain Manager Does Every business must have supplies and materials in order to run a successful operation Supply chain managers are employed to ensure that needed suppliers are always available to employees The job entails dealing with suppliers
 

Quality Aspects to Check While Writing COBOL Program

Quality Aspects to Check While Writing COBOL Program This article gives a general list which the programmer must check while delivering programs developed in COBOL This can also be used as a general checklist for checking quality of the COBOL program developed mosgoogle Quality is a vital factor fo
 

The Inheritance Concept In OOPs

The Inheritance Concept In OOPs In object oriented programming objects will be characterised by classes It is possible to learn a lot about an object based on the class it belongs to Even if you are not familiar with the name Maybach If I told you it is a car you would immediately know that it has f
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape