No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
**C++ Code:** #include <iostream> using namespace std; int sum(int n) { if (n <= 0) return 0; else return n + sum(n-1); } int main() { cout << "Range num? "; int num; cin >> num; cout << sum(num) << endl; return 0; } **My Pep/8 try at it:** br … |
|
Create a program that will input a sentence and push each character onto the stack all the while counting the number of characters. Then pop off each character and print them backwards (natural with a stack) and print the length. Like so: **I like burgers!** **!sregrub ekil I** ***The number … |
|
Create a simple calculator that has the following menu: A – ADD S – SUB N – NEG Q – Quit Input option: A Input number: 11 Ans = 11 Input option: S Input number: 5 Ans = 6 Input option: N Ans = -6 Input option: A Input number: … |