19 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for kouty

Hi my friends! Here is a wrong code, Wrong and I don't know why. My purpose is to make a **sieve of Erasthotene**. I make an unique function with many inner loops. But the execution **don't go cross the lines** I illustrate this with the help of printing the different …

0
201
Member Avatar for bnn678

So my code to test a prime number is as follows: PrimeTest(): test = input ( "What number would you like to test? " ) test = int(test) true = 0 divisor = 0 for divisor in range (2, 10): if ( (isinstance( test/divisor, int )== True) & (test/divisor == …

Member Avatar for bnn678
0
372
Member Avatar for logicslab

Dear Friends, I am looking a small thing , I need a simple code to check the input whether it's prime , if not can enter same repeateddly upto get a proper value . Please provide a simple code snippet and help me Thanks, Anes

Member Avatar for logicslab
-1
369
Member Avatar for UNDER-18 FG

I'm trying to write a coding that will be able to determine if a number keyed-in is a Prime Number or not. Here's what I did: public class PrimeNumber { public static void main(String args[]) { int n; Scanner Prime = new Scanner(System.in); System.out.println(" Please enter a number: "); n …

Member Avatar for jalpesh_007
0
680
Member Avatar for UNDER-18 FG

Hi, I had to make a java coding that will determine if a number is a prime number or not. Here's the coding I did: import.java.util.Scanner; public class PrimeNumber { public static void main(String args[]) { int n; Scanner Prime = new Scanner(System.in); System.out.println(" Please enter a number: "); n …

Member Avatar for Lucaci Andrew
0
306
Member Avatar for Pyler

/*Ok I have code that's behaving unexpectedly The following program is supposed to print prime numbers for n1=100,n2=1000,n3=10000 and n4=100000 except that for n1=100, it prints the squares of primes less than 10. I can implement this same program in c++ and wouldn't get such output. I need another pair …

Member Avatar for VernonDozier
0
230
Member Avatar for ben1996123

Hello, I just downloaded the [url=https://mattmccutchen.net/bigint/]big integer library[/url], and I want to use it in my prime number checking program. I downloaded the zip file and got a bunch of .cc and .hh files. I need to know what to do with the files, where I should put them, and …

Member Avatar for ben1996123
0
232
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
289
Member Avatar for Progr4mmer

I'm trying to make a program where you enter the number you want to find primes up to which then lists all the primes up to that number... But I enter 100 then it just sits there... Here's my code so far: [CODE]#include <iostream> #include <cmath> int prime(int); int main() …

Member Avatar for Progr4mmer
0
178
Member Avatar for Kanoisa

Hi all, I have begun workin on getting c++ to do physics and things for me so im working on some maths functions. starting small and working up, Just did this one on prime number generation and was wondering if anyone can point out any ways it could be ,made …

Member Avatar for Kanoisa
0
282
Member Avatar for Thisisnotanid

Hi everyone! I've built prime testers and prime listers before, but they only work sufficiently fast for values <= 1e6. I was thinking about all the prime tester projects they have going on, how do they test very large numbers for primality? I'm talking numbers on the order 1e12, 1e13, …

Member Avatar for Thisisnotanid
0
568
Member Avatar for Thisisnotanid

Hi everyone. I was trying to solve Pb 35 on Project Euler ([url]http://projecteuler.net/index.php?section=problems&id=35[/url]). It essentially asks to write a program to list all circular primes under 1e6. I wrote the program and it works well for the most part. However, in the end it seems not to be able to …

Member Avatar for Thisisnotanid
0
2K
Member Avatar for mrcpp

Hi, I tried doing Project Euler #27 today, which asks the following: [QUOTE] Euler published the remarkable quadratic formula: n² + n + 41 It turns out that the formula will produce 40 primes for the consecutive values n = 0 to 39. However, when n = 40, 40^(2) + …

Member Avatar for mrcpp
0
300
Member Avatar for Jimingle10

Intro - I am an electrical major. Having said that, my school has a pilot program this year that I was randomly selected for, that includes introduction to C# in the program. I am not very familiar with programming at all but I must admit, I have made decent progress …

Member Avatar for newenglandguy
0
849
Member Avatar for nwhitesel

Hi everyone! I am working my way through some problems from projecteuler.net and came across one that has stalled me. The task is to find the sum of all primes under 2,000,000. I am attempting to use the Sieve of Eratosthenes algorithm for identifying prime numbers. Here is my code …

Member Avatar for nwhitesel
0
216
Member Avatar for easyb

Hi techies, I am new into C++. I like to write a program that generates all the primes number between 1 and 100. Below is the code I have written but brings no output. Thanks for any help... [CODE]//A program that generates all of the prime numbers between 1 and …

Member Avatar for easyb
0
195
Member Avatar for dragontruong

I am unable to print out the error message when there is no input. I've tried different methods for it, but I can't get it to work. What am I missing? print should be: p2 invalid input but I get: p2 segmentation fault when I do this with an int …

Member Avatar for dragontruong
0
107
Member Avatar for trips.dude

Hi All, I am new to the programming world. I was just writing this code to generate N prime numbers. User should input the value for N which is the total number of prime numbers to print out. I have written this code but it doesnt throw the desired output. …

Member Avatar for samvinogar
0
17K
Member Avatar for ChaseRLewis

Newbie Here Edit: This is not homework, I am a chemical engineering student and a math minor. I'm doing programming on the side to help me automate certain calculations later in my career. Also always had a healthy interest in programming. I just read the not doing homework for people …

Member Avatar for vegaseat
0
208

The End.