Question about Computers & Internet

1 Answer

C++ programming i need a c++ program that checks that the given string is a palindrome using pointer concept

Posted by on

1 Answer

  • Level 2:

    An expert who has achieved level 2 by getting 100 points

    Hot-Shot:

    An expert who has answered 20 questions.

    Corporal:

    An expert that hasĀ over 10 points.

    Mayor:

    An expert whose answer gotĀ voted for 2 times.

  • Expert
  • 53 Answers

I hope this helps.
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()


{
clrscr();
char s[100];
int i,j,l,flag;
printf("\n enter a string:");
gets(s);
l = strlen(s);
j= l-1;
for(i=0;i<=j;i++,j--)


{
if(s[i]==s[j])


{
flag=1;
}
else
{ flag=0;
goto sar;
}
}
if(flag==1)


{
printf("\n string is palindrome");
}
else
sar:
printf("\n string is not a palindrome");
getch();
}

Posted on Oct 11, 2008

  • Kaleb Hawkins Oct 05, 2012

    That's C bro but its nice work. if you gave him his homework he failed...

×

1 Suggested Answer

6ya6ya
  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi,
a 6ya expert can help you resolve that issue over the phone in a minute or two.
best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of (from cars to computers, handyman, and even drones).
click here to download the app (for users in the US for now) and get all the help you need.
goodluck!

Posted on Jan 02, 2017

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1 Answer

Define a character array and use strcpy() to copy a string into it. Print the string out by using a loop with a pointer to print out one character at a time. Initialize the pointer to the first element and...


Nice, computer science homework.
int main () { char str[]="this is my string";
//print our string forwards int i = 0; while(str[i]!="\0") { putchar( str[i] ); i++; }
//newline putchar('\n');
//print our string backwards int length = strlen(str); while(length--) { putchar( str[length] ); } }
I didn't test this to make sure it worked, but this is the general way of doing this. It looks like your professor wants you to use pointers. I used pointers here. Do you know how? Arrays are pointers with some syntactic sugar.
I wouldn't rely on sites like this to get answers to your homework. Even if you get the right answer, there's always the possibility of your CS professor finding this answer online and then making your future homework ten times harder.

Mar 01, 2011 | Computers & Internet

1 Answer

Create a program that asks for a sentence. Your program will then check if the sentence is a palindrome or not.


Palindrome using C#.net

using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string str=string .Empty ;

Console.WriteLine("Enter a String");

string s = Console.ReadLine();

int i = s.Length;
//we can get the Length of string by using Length Property

for (int j=i -1; j >= 0; j--)
{
str = str + s[j ];
}
if (str == s)
{


Console.WriteLine(s + " is palindrome");


}
else
{
Console.WriteLine(s + " is not a palindeome");
}

Console.WriteLine(str);

Console.Read();


}

Nov 30, 2010 | Computers & Internet

1 Answer

18. A palindrome is a string that reads the same


here is a little vbscript sample str=InputBox("Type String To check For palindrome","")
strR=StrReverse(str)
half=Int(Len(str)/2)
If Left(str,half)=Left(strR,half) Then
    MsgBox ("It's a palindrome string")
Else
    MsgBox ("It's not a palindrome string")
End If

Jun 05, 2010 | Computers & Internet

2 Answers

Merging two arrays and sort them


NEED A NEW KEY THE ONE ON THE BOX WONT WORK

Jul 29, 2009 | Microsoft Windows XP Professional With...

1 Answer

To find palindrome


// String s contains word to check
boolean palindrome = false;//always false until proven otherwise
int i=0;
int len = s.length();
int halflen = (int)len/2;
for (i=0;i<len/2;i++)
if (s.charAt(i)!=s.charAt(len-i-1))
break;
if (i==halflen)
palindrome=true;

Mar 21, 2009 | Sun Java Desktop System

1 Answer

To print palindrome


// String s contains word to check
boolean palindrome = false;//always false until proven otherwise
int i=0;
int len = s.length();
int halflen = (int)len/2;
for (i=0;i<len/2;i++)
if (s.charAt(i)!=s.charAt(len-i-1))
break;
if (i==halflen)
palindrome=true;

Mar 21, 2009 | Intel Computers & Internet

1 Answer

Please Solve this C++ Program


Write a program to prompt the user to input several lines of input. A line of inputs is terminated by '*'. For each readline of input the program should output:(use pointer notation for the array) . The total # of words . The lenght of the longest word in the line At the end the program should output: . The total number of words read in all lines of input . The lenght of the longest word read in all lines of input

Jan 19, 2009 | Computers & Internet

1 Answer

Programming


This sounds remarkably like a homework assignment type of question. Any C++ reference book will contain examples of this. Also, look for books about data structures which will contain not only examples of the above, but complete explanations of the concepts and uses of each.
Dan

Mar 24, 2008 | Computers & Internet

1 Answer

C++


class Tester100
{

public static void main(String[] args)
{
for (int i =100; i<=999; i++)
System.out.println("palindrome"+=((i/100)+""+((i/10)%10)+""+(i%10)+""+((i/10)%10)+""+(i/100)));

}

Mar 21, 2008 | Computers & Internet

1 Answer

Help me javascript just mail me at ramzy_213@yahoo.com thanx


hello there!!!
First things First !
1) download the ultimate JAVA APL. run again.
O S

Feb 19, 2008 | Audio Players & Recorders

Not finding what you are looking for?
Computers & Internet Logo

Related Topics:

154 people viewed this question

Ask a Question

Usually answered in minutes!

Top Computers & Internet Experts

Brian Sullivan
Brian Sullivan

Level 3 Expert

27725 Answers

kakima

Level 3 Expert

102366 Answers

David Payne
David Payne

Level 3 Expert

14161 Answers

Are you a Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...