All Questions
529 questions
0
votes
1
answer
83
views
How to put an array(s) into another array - Java
I am trying to put an array(s) into another array so that I can output the numbers: 2, 7, 32, 8, 2. Must I be initializing the values somehow? Little confused. I tried three four loops but different ...
0
votes
0
answers
68
views
Compiler not working as intended or me not being able to find the flaw in my logic in C++ program [duplicate]
The following is supposed to return me with matrix who is the sum of m1 and m2 matrix provided prior in the program however, it returns with the garbage values instead.
The problem am trying to solve ...
1
vote
2
answers
74
views
My program does not print out the full array
Here is my code:
#include <stdio.h>
#define NEW_LINE 10
#define TAB 9
#define SPACE 32
int main() {
int c;
int counter1 = 0;
int counter2 = 0;
int word[10][10] = { { 0 } };
...
0
votes
1
answer
95
views
Unhandled exception while trying to print some value
I was writing my own implementation of vector, and when I was trying to print a number, some times I am getting an exception on the line in which I was trying to print it. I understand that the ...
0
votes
1
answer
417
views
According to my code , output results to . The expected output is 5. What is the mistake I am making?
We have to enter a array size which is n = 5. Then we sort the arrays on basis of their index in lists such as Odd and Even index. Then I am adding the second last element, it should result in 7 but I ...
0
votes
5
answers
92
views
How to output "hello" value only once from array containing "hello" two times?
the main goal is to write a method that finds the longest string in any given array. I don't quite understand how to adjust my code so that "hello" string value is output only once from the ...
-3
votes
2
answers
129
views
Why is it printing additional random characters? [duplicate]
enter image description here
the image shows the input taken and output shown .
I am taking character array as input and printing it, now when i print it, it print input characters as well as some ...
0
votes
1
answer
59
views
Why does my Loop not repeat after inputting a correct value from an String Array?
I'm creating a basic word puzzle program as a personal project where a user sees a set of letters and has to create as many words from that set of letters (ie. I T E R; rite, tire, er). A score is ...
0
votes
1
answer
202
views
Output all the odd and even numbers in the random numbers array
I declare an integer array of size 300, with random values from 1 to 500. I need to output all the even and odd numbers in the array 10 per line.
this is my code but I can't print 10 numbers per line ...
1
vote
1
answer
95
views
Count the Occurrences of a Substring in String
My program is supposed to count in a string an entered string.
For example:
Enter a text: Hello World
Enter a string: llo
occurs 1 times in Hello World
Unfortunately, my program does not give me ...
0
votes
1
answer
77
views
Multi Dimensional Array Calculation in php ( PHP Ranking not working )
Hi guys,
I have Result like this ,but Problem is this Result's Rank not correct , Please can you any one help for me, I have tried many times for many days now to get the result through this code but ...
0
votes
1
answer
52
views
Why array showing blank output?
import java.util.*;
public class javabasics {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter the size of array: ");...
0
votes
0
answers
180
views
save the output in a matrix or array in C programming
I have a C programming code, I am so basic at C and want to save the output in an array or matrix. In python one can easy append the output in a empty array.
now, I saved my output directly in a .csv ...
-1
votes
1
answer
62
views
Outputting data in a 2D std::vector
I'm having some trouble with outputting data from the vectors I have created.
Here is the code:
#include <iostream>
#include <cmath>
#include <vector>
using namespace std;
int main(...
0
votes
1
answer
63
views
C++ What is the easiest way to achieve my output goal?
I'm experiencing some formatting issues and not exactly sure how I can get it the way I want it. Instead of having the output displayed as
1 The contents of table1 are:
1 2 3 4
5 ...