33 Topics

Member Avatar for
Member Avatar for rfrapp

This problem is to print a square using a number that the user enters, which would be in the center. If the user entered a 5, then the program should output this: 111111111 122222221 123333321 123444321 123454321 123444321 123333321 122222221 111111111 If you're wondering, this was not a homework assignment. …

Member Avatar for pty
0
1K
Member Avatar for mrbrightside10

I'm so confused on this, can anyone please give me a hand. Thank you in advance. A program that uses the numbers from 1 - 12 and output the number, the square of the number, the cube of the number and finally the square root of the number. At the …

Member Avatar for ddanbe
0
1K
Member Avatar for 2384443

Hi everyone, i need your help.. I want to draw a circle,square and rectangle on Jframe on a click of a button.. This program was asked in my test paper, i couldn't get it right though bt i wanna know what my mistake is.. Plz help me.. import javax.swing.*; import …

Member Avatar for JamesCherrill
0
340
Member Avatar for ryan.jay.ong
Member Avatar for klika

So i have to write a c++ program for the Graeffe's square root method I have am stuck here when i have this formula transform into c++ code, the formula is on the link The code works particulary, the (elem[j-1]*elem[j+i]) doesn't work, it's beeing ignored and i don't know why... …

Member Avatar for tensity
0
1K
Member Avatar for Cj

For my c++ class i have to write a code that will read integers in to a 2D array from a file and then, using functions/methods, determine if the array is a magic square. My problem is that when i build or compile i get "error C2664: 'DataIn' : cannot …

Member Avatar for richieking
0
993
Member Avatar for piyush_2

hiii.! how to make a hollow square of asterisks by entering a size of side by user, for example if 4 is entered then, it will be print, * * * * * * * * * * * * of 4*4.

Member Avatar for JamesCherrill
0
204
Member Avatar for android_gl

how to test if a num is a square root? ex: 9 is square root 3 is not square root ///////////////////////////////////////////// //do not worry about sytax. int x = 0; //always start at 0 int y = 101010; //is this a square root? square(x, y){ if((x*x) >= y){ //not a …

Member Avatar for cwarn23
0
321
Member Avatar for Start4me

I’m making programs which will separate a two digit number from a textbox to two different labels. Later I want to take those two separate numbers and square them indiviudally and add them together. It would be great if someone can get me some help. This is what I have …

Member Avatar for Jx_Man
0
270
Member Avatar for teckforce

I was wondering the best way to implement a square root button. Below has everything from 0-9, the four functions, and a decimal and clear function. Dim valueOne As Single Dim valueTwo As Single Dim operation As Integer Dim answer As Single Private Sub Button1_Click(ByVal sender As System.Object, ByVal e …

Member Avatar for teckforce
0
243
Member Avatar for dantheman4

public static void sumOfSquareRoots() { Scanner scan = new Scanner( System.in ); double value; // read in a double System.out.print ("Enter a double:"); value = scan.nextDouble(); // calculate its square root double result = Math.sqrt( value ); // write out the result System.out.println("square root of your number is " + …

Member Avatar for delta_frost
0
2K
Member Avatar for vuquanghoang

I have a code on the Internet and I have rewritten it, but there are t and n3 variable in the odd_order function that I don't understand their meaning. Please help me to explore it. :D. This code is generating a odd order magic square. <html> <head> <title>Magic Squares</title> <script …

Member Avatar for fobos
0
221
Member Avatar for abhishekagrawal

Dear All, I have written a program to find the smallest divisor of an input number. The code gives me an error in lines 19 and 23. The error is invalid operands to binary %. Please help me to troubleshoot, thank you. Below is my code: #include<stdio.h> #include<stdlib.h> #include<math.h> int …

0
193
Member Avatar for abhishekagrawal

Dear All, I have written a program that finds the integer whose square is closest to but greater than the integer number input as data. But it is giving me an erroneous answer. My algorithm is: 1. Select a number which is half the input number. 2. Square it and …

Member Avatar for nullptr
1
243
Member Avatar for bastiaanvos

I was doing some past exam questions as a way of studying for an exam next month. One of the questions that I could not do was this: "Write a procedure that returns a two dimensional square array of size n x n, initialised with random real numbers between -100 …

Member Avatar for Momerath
0
209
Member Avatar for O_mini

Program created in BlueJ: For this Assignment I am to create a magic square from odd numbers >= 3 input by the user. I want to test my code to see if it works, but I can't figure out how to actually print the square from the number input by …

0
418
Member Avatar for umair jameel

How print this series in while loop square root 1 2 4 8 16 32 64 128.......... and cube root 2 8 24 72........

Member Avatar for stultuske
1
1K
Member Avatar for joankim

Hi :) I am trying to make a program that will find the first x perfect squares. I have done and redone this many times, but it never works. So basically, it needs to do two things: check if y is a perfect square. If it is, it needs to …

Member Avatar for joankim
0
946
Member Avatar for cka91405

Im writing a code that ask for two positive integers entered from the keyboard. The first integer N is odd in range of 3-15 and the second with be an initial value I. N will be the size of the array. Beginning the center of the NxN array with the …

Member Avatar for Adak
0
274
Member Avatar for bobytch

Good Day Everyone here is my code so far [CODE] #include <graphics.h> #include <stdlib.h> #include <stdio.h> #include <conio.h> void vp(int x,int tc,int bk,char *text); void square(int x,int y,int size); void main() {//=========================================================== int gdriver = DETECT, gmode, errorcode; initgraph(&gdriver, &gmode, "C:\\TC\\BGI"); //------------------monitor-------------------- setbkcolor(0); setcolor(15); square(300,160,150); square(300,160,148); square(300,160,130); square(300,160,131); setaspectratio(2,5); int …

Member Avatar for vidit_X
0
271
Member Avatar for caut_baia

Hi.Someone asked a day or two ago for a way to extract the square root of a number without using the std::sqrt function so i thought about writing my own.Here it is and please feel free to criticize.

Member Avatar for maninaction
0
385
Member Avatar for salty11

In this program i am trying to find numbers that are multiples of 7,11, or 13, also if the total of the numbers is even or odd also the square root value of each number also if there are any prime numbers in the list [CODE]#include<iostream> #include<iomanip> #include<fstream> #include<cmath> #include<conio.h> …

Member Avatar for frogboy77
0
287
Member Avatar for EkoX

hi, i try to make a square number but its not limited by 2. number and the square can be any numbers. so its like n^n. please help me.. i confused how to do this.. any help will be appreciated. thanks.

Member Avatar for Wolfgan
0
218
Member Avatar for Mr Programmers

Hi all, 1. When I insert an icon in my VB.NET form, for example: a small shield icon, a white box appears around it and it's very annoying and ugly! I want to disappear the white box at the back of my .ico image. 2. This white backgroud not only …

Member Avatar for Mr Programmers
0
356
Member Avatar for parth27987

Hello people, Need help with this code here. This code suppose to print blocks of char assigned by user with certain rows and column also assigned by user. For some reason it is giving me error and i don't understand what the problem is Help will be greatly appreciated. Thanks! …

Member Avatar for parth27987
0
198
Member Avatar for parth27987

Hello people, This is first time i am using this site to get help. Any way to the point, The code provided below suppose to make a blocks of squares with certain rows and column. All the field, rows and columns are controlled by user. User can also choose which …

Member Avatar for SgtMe
0
205
Member Avatar for insanely_sane

Ok... So I have the following program: [CODE]public int seq2 (int n) { if (n <= 0) return 1; else return seq2 (n - 1) + 2 * n - 1; }[/CODE] It gives the following output: 1 2 5 10 17 26 37 50 65 82 So that means …

Member Avatar for insanely_sane
0
184
Member Avatar for flyingcurry

The task is to use a recursive algorithm to determine the sum of two numbers n1 and n2. I just keep on returning to using the formula n1*n1 +n2*n2 The part which I have questions is I don't get how to do this in a recursive way. Thanks!

Member Avatar for flyingcurry
0
2K
Member Avatar for flyingcurry

For homework, we have to find the time complexity class of certain algorithms and explain why it has that certain complexity class. So, I have a couple of questions: - Why is the first running time always so much longer than the ones after? (setting up the application or something??) …

Member Avatar for tong1
0
210
Member Avatar for jonyshub

Hi everybody! Sorry for my bad english! I have a matrix of integers with a maximum length 6 digits. I must to write program, that checks whether a number is found in the section above the main secondary diagonal of this matrix. I'm beginner in C + + and I …

Member Avatar for farag
0
142

The End.