35 Topics

Member Avatar for
Member Avatar for Petcheco

Hello, friends. I did the fourth challenge on Project Euler and I'd like to know what I can do to improve the efficiency of my code. Right now it takes 1.562s to run and the source code is as follows: #include <iostream> #include <string.h> using namespace std; int Number = …

Member Avatar for memson
0
411
Member Avatar for nathan.pavlovsky

Hello programmers! After covering the basics of STL, I decided to complete the following assignment: `Write a function template palindrome that takes a vector parameter and returns true or false according to whether the vector does or does not read the same forward a backward.` So, for example, a vector …

Member Avatar for NathanOliver
0
1K
Member Avatar for phony

I get an error when I try to compile my code. I can't figure it out. It says it's not declared but I think it is declared. // // // This menu-driven program is used to allow the user to choose // an application to be executed. // // // …

Member Avatar for phony
0
741
Member Avatar for saja.omarii.7

A palindrome is a word or sentence that reads the same forward as it does backward. Write C++ code that read string consist of 6 characters only and check if the string palindrome word or NOT.

Member Avatar for Jamblaster
0
334
Member Avatar for reloadmvp

SO guys I am supposed to be making a program that will check for a palindrome but, I can not get my code to work. It seems to be stuck on the cmp part. I am not sure if this is even right I dont have much experience with masm. …

Member Avatar for turboscrew
0
1K
Member Avatar for nirbilcahn

http://ideone.com/H7YIwR Here's my code to find palindrome in string..But surely it's too slow..Is there any good algorithms for such problems..And for some cases it's not giving the right answer.Thanks for the help.

Member Avatar for vijayan121
0
406
Member Avatar for MiCro0o

I a new c++ programmer, and i started to solve the SPOJ online challenges just practising , and because of my few experiance.. it gives me wrong answers alwayes. See [ **the Challenge** ](http://www.spoj.com/problems/PALIN/) here. My Code : #include<iostream> #include <vector> using namespace std; int reverse(int input) { int last_digit; …

Member Avatar for mitrmkar
0
273
Member Avatar for femaler2d2

I have started using emu8086 and since I’m new to this I got stuck with my project that I have to submit till Friday :((( I need to make a program in assembly that counts how many words in a given sentence are palindromes: For example: Dad loves mom (in …

Member Avatar for femaler2d2
0
152
Member Avatar for ThatJamaican

#include <stdio.h> #include <stdlib.h> int main() { char word[50]; int wordLength, i, reverseCount; reverseCount = 0; system( " color F5 " ); printf( "\n How many letters does the word have? : " ); scanf( "%i", &wordLength ); printf( " \n Enter word, letter by letter " ); for( i …

Member Avatar for Gonbe
0
260
Member Avatar for babi.meloo

I need to create a palindrome tester program that ignores spaces, punctuation and uppercase/lowercase to determine if the string given to the user is a palindrome (same beginning to end as end to beginning). HERE'S WHAT I HAVE SO FAR: String str, another = "y"; int left, right; Scanner scan …

Member Avatar for JamesCherrill
0
2K
Member Avatar for TrustyTony

Here is slow brute force way to find the largest palindromic product of three digit integers. You could do loop and break out of it if you go under the smaller number (the second one) of best solution found so far to be more efficient etc.

Member Avatar for hughesadam_87
0
544
Member Avatar for vallarakesh

this program is to find the largest palindrome of 3 digit numbers.this code is workig for two digit numbers but it is not working for 3 digit numbers. `` #include<stdio.h> #include<conio.h> #include<math.h> void main() { int i,j,con=0; long int num=0,res=0; clrscr(); for(i=999;i>900;i--) { for(j=999;j>i;j--) { num=(i*j); con=pal(num); if(con==0&&num>=res) res=num; } …

Member Avatar for 2teez
0
199
Member Avatar for jhamill

Hey so this is my code for checking for palindromes...it compiles fine, the problem is it doesnt work. Basically I converted the four sentences into strings without spaces or other characters and added them to a new string called newstr....i used the newstr to check for a palindrome in the …

Member Avatar for NormR1
0
307
Member Avatar for blake81

I need a little bit of help with my coding below. Whenever I try to run the second application it gives me momPalindrometrue dadPalindrometrue sisterPalindromefalse racecarPalindrometrue JavaPalindromefalse A man a plan a canal PanamaPalindromefalse Hurray for HollywoodPalindromefalse Mr Owl ate my metal wormPalindromefalse Was it a car or a cat …

Member Avatar for NormR1
0
284
Member Avatar for utkarshsahu

I wanted to write a program to check if string entered is a palidrome. I wrote a program but i get errors while compiling. Can anyone help me identify errors in the program. [CODE] #include<iostream> #include<string> int main(){ string input;bool flag=false; cout<<"Enter String: "; cin>>input; cout<<"You Entered "<<input; int length= …

Member Avatar for utkarshsahu
0
183
Member Avatar for oberlin1988

I'm writing a program that checks a txt file with a list of words (one word per line). I'm just this side of done, I think. [CODE]def StripPunctuation(s): answer="" for c in s: if c.islower() or c.isupper(): answer=answer+c.lower() return answer def Reverse(s): answer="" for c in s: answer=c+answer return answer …

Member Avatar for Lucaci Andrew
0
3K
Member Avatar for seion

Practicing C++ and here is two of the practice problems I pulled from the FAQ And practice post. Just want feedback and issues with the way I wrote these. Simple Calculator [CODE] #include <iostream> #include <string> #include <sstream> #include <stdlib.h> using namespace std; int main(void) { //cout << string(50, '\n'); …

Member Avatar for Clinton Portis
0
152
Member Avatar for zck17

I'm trying to make a Palindrome program, that basically returns whatever you enter, just backwards. For some reason, the cNewArray is not only couting the original array backwards, but also the original array. For example if I enter "Hello" it returns "Hello = olleHHello". I'm very new to referencing pointers …

Member Avatar for mikrosfoititis
0
180
Member Avatar for Kyle Willett

I need help with a programing assignment for my CS 2 class, the task is to check rather a user inputted string is a palindrome meaning it is the same forwards as it is backwards. I have most of the program working, I input a string then copy it and …

Member Avatar for frogboy77
0
263
Member Avatar for kkasp

I've searched all over, but Have not been able to find exactly what I need help on. I am creating a program that takes user input of a word and determines if it is a Palindrome or not....the catcher is I need to use stacks. They are confusing to me. …

Member Avatar for TrustyTony
0
1K
Member Avatar for xploxstriker

I've just started Python and need to write a program that tells if a string is a palindrome. Here is what I have so far. [CODE] def palp(word): if len(word) < 2: return True left_index = (0) right_index = len(word) - 1 while len(left_index) <> len(right_index): return False if left_index …

Member Avatar for snippsat
0
569
Member Avatar for D33wakar

Here's a code to find out if the number is palindrome or not. [CODE] #include <stdio.h> int main() { int num,chknum1,chknum2=0,i,rmndr;/*here rmndr is remainder after mod,chknum is reversed num*/ printf("enter the number"); scanf("%d",&num); chknum1=num;/*saving num,since it is manipulated*/ for(i=0;i<=sizeof(chknum1);i++) { rmndr=num%10; num=num/10; chknum2=chknum2*10+rmndr; } printf("chknum1 %d,chknum2 %d",chknum1,chknum2); //if(chknum1=chknum2) //printf("Is palindrome"); …

Member Avatar for TrustyTony
0
448
Member Avatar for TrustyTony

As [URL="http://www.daniweb.com/software-development/c/threads/377568/1625821#post1625821"]Goddess Narues' C code in C forum[/URL] was over my head and her critique of simplistic solution maybe overflowing the integer range was valid in C, I worked out a recursive solution more suitable to my brain in my preferable language. Maybe one day I put in C, now …

0
246
Member Avatar for Sturdy

hi all.. how i can check there are palindrome in textbox. e.g : i input "daniweb a bewinad" thanks and please help.

Member Avatar for Sturdy
0
800
Member Avatar for george61

This is a fragment of a program for finding palindrome numbers.Every checked number is a string which is reversed...and I'm using array of strings which isn't done right. Any help will be greatly appreciated. [CODE]#include <stdio.h> #include <string.h> void isPalindrome(char *str1[],int l){ int str1size = strlen(str1[l]); int n; int misMatch …

Member Avatar for b56r1
0
108
Member Avatar for Prisms

Hello I have been working on this program for a few days and have gotten stuck. I allow the user to enter in a string and remove special characters and turn upper case characters to lower case. after all that is done i compare the characters in the string to …

Member Avatar for Prisms
0
297
Member Avatar for Prisms

Hello I have been working on this program for a few days and have gotten stuck. I allow the user to enter in a string and remove special characters and turn upper case characters to lower case. after all that is done i compare the characters in the string to …

Member Avatar for peter_budo
0
158
Member Avatar for Jevilon

Hi! First of all I would like to apologize; I dont usually ask for favours but I have blocked with a Sparc exercise. [CODE]"Write a program in assembly language SPARC applying multiple string from the keyboard. The end of the sequence of strings is determined by a null string. The …

0
118
Member Avatar for hsetaknev

i have a problem with my coding to fing wether given string is palindrome or not without using strcmp(); and srtrev(); it returns "the string is not a palindrome " for all string the [CODE]#include<stdio.h> #include<string.h> void main() { int n,i,j; char a[100]; scanf("%s",a); n=strlen(a); printf("the length ia%s,%d\n",a,n); while(i<=j) { …

Member Avatar for Shankye
0
111
Member Avatar for Bardan Jusik

Hello! I need to write a program to find whether a word is a palindrome or not. What differentiates this from the other palindrome threads in this forum is that I can only use certain functions. They are: If statements, string functions (to upper, to lower, indoxof, length, substrings), for …

Member Avatar for Bardan Jusik
0
282

The End.