I would like to do this, but I still don't quite get it. Where is every element stored in my current program?
Type: Posts; User: Kelton2
I would like to do this, but I still don't quite get it. Where is every element stored in my current program?
I have a problem where eight queens are to be placed on an 8x8 chessboard in such a way that no queens will be able to attack each other (i.e., lie along same row, column or diagonal). The program...
Except I know that that if condition is wrong, but I don't know what it should be.
I don't get what you're saying.
Anyways, I made progress:
#include <iostream>
using namespace std;
int main ( ) {
int num;
int array[40];
cout << "Enter number of numbers here:...
Okay, so what I've found out is that the # is printing the wrong number of times, and it might be trying to print in the wrong place. I'm not sure how to fix it though-is it something with one of the...
Post updated, still need help.
I still need help, so I bumped the topic, and nobody has replied.
Okay, here is the indented code:
#include <iostream>
using namespace std;
int main ( ) {
int num;
int array[40];
cout << "Enter number of numbers here: ";
cin >> num;
Only I don't have a reply yet....
Title. I'm working on a vertical bar graph program, and it doesn't work.
What it should print:
Number of values to graph: 3
1 2 3
#
# #
# # #
Nevermind, solved.
Update: It still doesn't work, but I have updated my code. It now has a revised main and prints in a different way. My code is below:
#include <iostream>#include <iomanip>
#include <cmath>...
I have changed it back to iteration and I now have:
#include <iostream>
using namespace std;
int explode(int number,int array[])
{ int variable = number;
int numberOfDigits = 0;
...
Title. Can someone help me fix it?
int exploder(int number,int array[]) {
int functi = 0;
int digit = number % 10;
while (number > 0) {
// int digit = number % 10;
...
Isn't it already like that?
How would I check for that?
I got it to work with recursion, but it prints one too many comma and IDK how to fix it:
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int explode(int...
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int explode(int number,int array[])
{
int digit = number % 10;
while (number > 0) {
Yes, but it won't always be in that position. I printed digits[4] anyways, and it didn't work. I don't understand how I can get it to print in the right order.
And how would I reverse the order?
I figured it out, but it prints backwards:
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
void explode(int number,int array[])
I can't get this to work, please tell me what I am missing:
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int explode(int number, int array[])
I would rather print it differently, but how?
It's data (what's printed finally is data[i]). What do I need to change in it?
I'm still confused? What array/variable do I need to change to what to make it print right?