49,757 Topics

Member Avatar for
Member Avatar for Petcheco

Hey, guys. A Pythagorean triplet is a set of three natural numbers, a < b < c, for which, a² + b² = c². For example, 3² + 4² = 9 + 16 = 25 = 5². There exists exactly one Pythagorean triplet for which a + b + c …

Member Avatar for Petcheco
0
348
Member Avatar for phoenix254

HI everyone, I need help in c++. Problem : I want to write a program that calculate x digits of pi. Like if my input is 3 output should like this 3,14 or this 3,145 if my input is 10 output should like this 3,14529xxx or lik this 3,14529xxxx. I …

Member Avatar for phoenix254
0
253
Member Avatar for Thomas_25

Hi all, This is something very basic i know. I just wanted to avoid some confusion. What is the difference between char *names[100]; and char names[100]; This is what i know char names[100]; - its just a character array which can hold 99 characters and the last one will be …

Member Avatar for deceptikon
0
275
Member Avatar for Thomas_25

If i have an array of names char *names[100]; (stored as pointers to strings), how to find the name that appears the most times in the array and how many times it appears. (a) if only one “mode” (b) multiple “modes” I'm thinking of implementing something similar to selection sort …

Member Avatar for tinstaafl
0
713
Member Avatar for Petcheco

Hello, guys. How would I deal with a variable that needs to be biggers than an unsigned long long integer? Thank you.

Member Avatar for Petcheco
0
193
Member Avatar for Petcheco

Hello, guys. This challenge asks us to find the 10001-th prime. Here's my code: // A reasonable approximation is to say that the n-th prime is such that p(n) = n*(log n + log*(log n) - 1). // With that in mind, we can say that the 10001-th prime is …

Member Avatar for Petcheco
0
255
Member Avatar for einteristi

HELLO everyone i have a problem with which link is here can anyone help me please http://acm.epoka.edu.al:8080/en/problem-pid-c50f?ps=1&smt=a&smpwid=0

-1
113
Member Avatar for arucke20

This is what I have so far #include <iostream> #include <iomanip> using namespace std; const int NUM_SECTIONS = 3, NUM_ROWS = 5, NUM_COL = 9; int main() { int seatTable[NUM_SECTIONS][NUM_ROWS][NUM_COL] = { { { 100, 100, 100, 100, 100, 100, 100, 100, }, {100, 100, 100, 100, 100, 100, 100, …

Member Avatar for arucke20
0
108
Member Avatar for CattleOfRa

I've just started learning C++ on Linux. I have written a very small program which compiles but I get run time errors everytime I run it. The code is shown below: #include<iostream> int DoubleOf(int n); int main() { std::cout << "Double of 5 is " << DoubleOf(5); return 0; } …

Member Avatar for sepp2k
0
190
Member Avatar for A. Gregory

how do you write a c++program using the do while and while do loop to list prime numbers between one and thirty

Member Avatar for David W
0
178
Member Avatar for Ma Nicole Ydralyn

Hi guys I am really having trouble on what to do with my program. We are asked to make a cashier's program and I don't know how to do the the Receipt... I don't know what to do in the order part... how about if the customer will order 3 …

Member Avatar for David W
0
6K
Member Avatar for hadisur_rahman

Write a program to check the password is too strong or strong or weak & also check the password is validate or not.. you can use code of c/c++ and you want ....

Member Avatar for Lutina
0
631
Member Avatar for basitji

Write a program that accepts three values from a user and print the two highest value and thier sum.

Member Avatar for Lutina
0
121
Member Avatar for tgreiner

OK, so I've asked a question like this before and I thought I understood the answer (solved) but I am having problems again and I still do not understand why. I am compiling with MinGW. Here's the code: string filename="D:/__GNU analyze/test/bin/Debug/_ClusterFormat/Test2.6d .txt"; fstream file, file2; string cluster="frame"; string line; Matrix …

Member Avatar for tinstaafl
0
140
Member Avatar for danielg55

I have this in a code: ` int load_snapshot(char *fname, int files) { FILE *fd; char buf[200]; int i, j, k, dummy, ntot_withmasses; int t, n, off, pc, pc_new, pc_sph; #define SKIP fread(&dummy, sizeof(dummy), 1, fd); for(i = 0, pc = 1; i < files; i++, pc = pc_new) { …

Member Avatar for rubberman
0
97
Member Avatar for Ahmed_62

plz some one explain in details this code : we have array of 9 cells and 0 present empty locations we want solution of this array (no number will be repeated) also if there is any way to call this functions in main so as the program runs succesfully plz …

Member Avatar for gusano79
0
201
Member Avatar for Syed Ammar

Hey guys im having a problem in structures.. i dont know how to initialize a an array of 10 contact instances.. plz help me out. this is my question statement.. "Declare a structure Contact that has a name, address, mobile number. Now create and (hardcoded) initialize an array of 10 …

Member Avatar for Moschops
0
230
Member Avatar for cannon_1

hi i have a unknown string in c++ containing "\n" "\t" etc. say; string unknown1="\n\t\n\t\n\n\n\n\n"; now I want to print "\n\t\n\t\n\n\n\n\n" to the screen explcitly other than a bunch of empty spaces.... how should I do that? remember that I don't know what is in unknown1...

Member Avatar for tinstaafl
0
482
Member Avatar for adnan_6

I have downloaded the program from here http://www.tightvnc.com version 2.7.10 and compiled successfully using visual studio 2013. One is the tvn server and other is the viewer. We connected successfully the server and viewer using my friend’s laptop pair with server and client interaction. When the application runs all the …

Member Avatar for tinstaafl
0
2K
Member Avatar for Ahmed_62

Hello Everybody , i have array of size 9x9 i want to write a function to Check each 3x3 box

Member Avatar for Ahmed_62
0
297
Member Avatar for danijohn

when I exit a function i get 'general protection exception' -' processor fault'. Function writes to file and works ok except won't exit. What does this mean please, and where should I look ? Am using Turbo C 4.5 & Windows xp. Must be overwriting memory somehow I suppose but …

Member Avatar for alifriend7
0
593
Member Avatar for kearradcrs

Use an array to store the grades. Use a looping structure to populate the array. Calculate the numeric average based upon the 4 equally-weighted numeric grades. Display each of the 4 numeric grades from the array on the screen using a looping structure. Display the numeric average. Create a function …

Member Avatar for David W
0
194
Member Avatar for Hassaan_2

hi all ihave required a program any body help me please Write a programme that use three arrays mango, orange and banana to store the number of fruits purchased by customer. The programme inputs the number of mangoes, oranges and bananas to be purchase by customer and stored them in …

Member Avatar for David W
0
395
Member Avatar for Petcheco

Hello, guys. The four adjacent digits in the 1000-digit number that have the greatest product are 9 × 9 × 8 × 9 = 5832. 73167176531330624919225119674426574742355349194934 96983520312774506326239578318016984801869478851843 85861560789112949495459501737958331952853208805511 12540698747158523863050715693290963295227443043557 66896648950445244523161731856403098711121722383113 62229893423380308135336276614282806444486645238749 30358907296290491560440772390713810515859307960866 70172427121883998797908792274921901699720888093776 65727333001053367881220235421809751254540594752243 52584907711670556013604839586446706324415722155397 53697817977846174064955149290862569321978468622482 83972241375657056057490261407972968652414535100474 82166370484403199890008895243450658541227588666881 16427171479924442928230863465674813919123162824586 17866458359124566529476545682848912883142607690042 24219022671055626321111109370544217506941658960408 07198403850962455444362981230987879927244284909188 84580156166097919133875499200524063689912560717606 05886116467109405077541002256983155200055935729725 71636269561882670428252483600823257530420752963450 Find the thirteen adjacent digits …

Member Avatar for Petcheco
0
288
Member Avatar for hadisur_rahman

# we get month for (month=days/30;) years for ( years=month/12;) but we also get days for(( days=days%30, why it happend explain ??)) #

Member Avatar for rubberman
-1
211
Member Avatar for basitji

hi all friends plz help me. i have an assingment giving by sir. write a program that accepts three values from user and print the highest value from them? remember: The program should be for turbo c.

Member Avatar for rubberman
0
97
Member Avatar for Petcheco

Hello, guys. Here's the challenge: 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20? I wrote my code: #include …

Member Avatar for Petcheco
0
319
Member Avatar for CodeWarrior14

Hello, A simple program I am writing uses a struct to store a key and key size variable. However I get an error that states that my struct variable is being used without being initialized... I dont really know why it is telling me that. Code: `keygen.hpp` #include <ctime> #include …

Member Avatar for jencas
0
174
Member Avatar for 04279169

04279169@uofn.edu.om Do Muluplication in this program ? #include<iostream> using namespace std; class Node { private: int row;// different data type for other apps int column; int value; Node *next; // the link pointer to next item public: Node(int x=0,int y=0,int z=0,Node * ptr=NULL); // constructor int getRow(); int getColumn(); int …

Member Avatar for startomana
0
208
Member Avatar for Andrey_4

Authors of PVS-Studio static code analyzers offer programmers to test their sight and to try finding errors in C/C++ code fragments: https://software.intel.com/en-us/blogs/2015/04/24/lets-play-a-game-find-bugs-in-popular-open-source-projects

Member Avatar for Suzie999
0
198

The End.