No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
So uh, i need some help with these functions..i gotta reverse, but i do not have the functions that can make it lowercase, or remove punctuation [code=cplusplus] #include <iostream.h> #include <string.h> char your_string[256]; char new_string[256]; void ReverseString(); void main() { cin.getline(your_string, 256); ReverseString(); cout << ReverseString(your_string) << "\n"; } void … |
|
Just some challenge code for ya, and some help for me on my independent study of C++ code a program that checks whether a string is a pseudo-palindrome.(a sentance that is spelled the same backwards/forwards. first code the following functions: char * remove_punct(char * str, char * remstr); char * … |
|
*EDIT* INTERPRET! lol....sorry! Write a recursive function array_sum(int *array, int size, int index) that computes the sum of all the elements of the array starting with position "index". Okay thats not too bad..but then he said this for example, if an array A holds the values 5,4,3,2,1 then the call … |
|
Hello mates! I'm having quite a bit of trouble reversing a set of integers using recursion. The user enters a positive integer. The program then takes that integer, and lists 0,1,2...Number originally entered. The function SumTo lists zero to N, however I now need to reverse that list. Like this... … |
|
My Prof gave me this to work with.... the following function accepts an integer greater than 0, as an argument and it returns the sum of the squares of the numbers 1 through N. For example: squares(3) must compute the value 1^2 + 2^2 + 3^2, that is, 14. I … |
|
[code] #include <iostream> using namespace std; int fib(int n); int main() { int n, answer; cout << "Enter number to find: "; cin >> n; cout << "\n\n"; answer = fib(n); cout << answer << " is the " << n << "th Fibonacci number\n"; system("PAUSE"); return 0; } int … |
|
Alright! I have to make a program that computes the n'th Fibonacci number, and then use it in a program to list the first 20 fibonacci numbers, the recursive definition of fibonacci numbers is: fibonacci(1) = 1 fibonacci(2) = 1 fibonacci(3) = Fibonacci(n-1)+Fibonacci(n-2), for n>2 then modify your program and … |
|
Re:
Hi guys, I'm working on a program that has to do with Goldbach's second conjecture (any even number larger than 5 can be expressed as the sum of three prime numbers). I have to write a program that takes integer [I]n[/I] (larger than or equal to 6) and finds three … |
|
I am very new to C++, and am struggling with these problems. I must enter in a 10 integer array, and then reverse the array. I do not want to make a function, or use characters, just simple code, this is what I thinking is along the lines of the … |
|
Hello, i made this code, it is giving me random numbers, but 1 too many, and a couple numbers out of the range..please help!!! [code] #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main (){ int x; //range number 1 int y; //range number 2 int m; //how … |
|
Hello! I was wondering how to generate random numbers within a given range X and Y using rand. Thanks!! I was thinking that it may be along the lines of [code] rand() & x+y [/code] however this does not work. Any help would be amazing! Thanks guys and gals! |
|
Hello, i need some help with C++...I'm attempting to make an 4x4 array. The user inputs the array "Line 1: " // the the user inputs his 4 numbers for line 1 and so on.... the program then adds the array across on all 4 lines, and twice diagonally. I … |