primeros numeors primos menores que
C++
#include<bits/stdc++.h>
using namespace std;
bool Is_Prime(long long x){
if(x%2==0)return false;
for(int i=3;i*i<=x;i+=2)
if(x%i==0)return false;
return true;
}
int main(){
//primes less than n
int n;
cin>>n;
int primes=0,i=1;
while(primes++<n){
while(!Is_Prime(++i));
cout<<i<<" ";
}
}
Also in C++:
- Title
- check an stack is empty c++
- Category
- C++
- Title
- c++ string to int
- Category
- C++
- Title
- how to use max_element in c++ with vector
- Category
- C++
- Title
- c++ isalphanum
- Category
- C++
- Title
- substr c++
- Category
- C++
- Title
- switch c++
- Category
- C++
- Title
- iterative preorder traversal
- Category
- C++
- Title
- unordered_map c++ insert
- Category
- C++
- Title
- c++ string to stream
- Category
- C++
- Title
- assegnare valori in c++
- Category
- C++
- Title
- is x prime?
- Category
- C++
- Title
- pop from between string c++
- Category
- C++
- Title
- how to create object in c++
- Category
- C++
- Title
- how to convert a string to a double c++
- Category
- C++
- Title
- how to delete something in an array c++
- Category
- C++
- Title
- primeros numeros primos
- Category
- C++
- Title
- how the theam are store in database
- Category
- C++
- Title
- c++ convert int to cstring
- Category
- C++
- Title
- how to output text in c++
- Category
- C++
- Title
- getline in c++
- Category
- C++
- Title
- free or delete in c++
- Category
- C++
- Title
- cout value c++
- Category
- C++
- Title
- c++ read matttrix from text file
- Category
- C++
- Title
- c++ template function
- Category
- C++
- Title
- hashset in c++
- Category
- C++
- Title
- How to find the kth smallest number in cinstant space
- Category
- C++
- Title
- linear search in c++
- Category
- C++
- Title
- class in c++
- Category
- C++
- Title
- what is time complexity of insertion sort
- Category
- C++
- Title
- convert string to stream c++
- Category
- C++
- Title
- multiple words C++ in same
- Category
- C++
- Title
- map insert c++
- Category
- C++
- Title
- map arduino
- Category
- C++
- Title
- how to have a queue as a parameter in c++
- Category
- C++
- Title
- shortest path with bfs in c++
- Category
- C++
- Title
- passing a vector to a function c++
- Category
- C++
- Title
- maximum subarray sum equal with K in c++
- Category
- C++
- Title
- c++ convert int to double
- Category
- C++
- Title
- flushing output in c++
- Category
- C++
- Title
- how to delete an element in vector pair in cpp
- Category
- C++
- Title
- for loop
- Category
- C++
- Title
- matrix class in c++
- Category
- C++
- Title
- c++ overloaded == operator
- Category
- C++
- Title
- c++ random numbers
- Category
- C++
- Title
- syntax c++
- Category
- C++
- Title
- c++ parse int
- Category
- C++
- Title
- range based for loop c++ with reference
- Category
- C++
- Title
- max in c++
- Category
- C++
- Title
- findung the mode in c++
- Category
- C++
- Title
- trovare il valore massimo in un array c++ w3
- Category
- C++
- Title
- c++ initialize a vector
- Category
- C++
- Title
- c++ throw exception
- Category
- C++
- Title
- c++ for loop syntax
- Category
- C++
- Title
- how to switch to another branch in git
- Category
- C++
- Title
- binary tree search
- Category
- C++
- Title
- how to initialize a vector in c++
- Category
- C++
- Title
- sieve of eratosthenes c++
- Category
- C++
- Title
- how to print eachh chars in string data type in c++
- Category
- C++
- Title
- how to run c++ file mingw cmd
- Category
- C++
- Title
- how to measure program run time in c++
- Category
- C++
- Title
- check if intent has extras
- Category
- C++
- Title
- delete a double pointer c++
- Category
- C++
- Title
- how to check type in c++
- Category
- C++
- Title
- matrix eigen c++ example
- Category
- C++
- Title
- never gonna give you up lyrics
- Category
- C++
- Title
- c++ public inheritance not getting protected
- Category
- C++
- Title
- C++ If
- Category
- C++
- Title
- gcd in c++
- Category
- C++
- Title
- check if key exists in map c++
- Category
- C++
- Title
- c++ program to find gcd of 3 numbers
- Category
- C++
- Title
- new in c++
- Category
- C++
- Title
- c++ vector iterator
- Category
- C++
- Title
- making random numbers in c++
- Category
- C++
- Title
- nth_element c++
- Category
- C++
- Title
- peak in c++
- Category
- C++
- Title
- Html tabulation
- Category
- C++
- Title
- c++ class constructor
- Category
- C++
- Title
- border radius layout android xml
- Category
- C++
- Title
- c++ string
- Category
- C++
- Title
- string input
- Category
- C++
- Title
- object slicing in c++
- Category
- C++
- Title
- pass by reference c++
- Category
- C++
- Title
- sum of integer in array c++
- Category
- C++
- Title
- screen record ios simulator
- Category
- C++
- Title
- translate
- Category
- C++
- Title
- euler's totient function c++
- Category
- C++
- Title
- c++ write string
- Category
- C++
- Title
- c++ comment
- Category
- C++
- Title
- Merge k sorted linked lists and return it as one sorted list.
- Category
- C++
- Title
- counting valleys hackerrank solution in c++
- Category
- C++
- Title
- c++ how to return an empty vector
- Category
- C++
- Title
- how to convert string into number
- Category
- C++
- Title
- c++ code to print hello world
- Category
- C++
- Title
- rand c++
- Category
- C++
- Title
- building native binary with il2cpp unity
- Category
- C++
- Title
- repeating character in c++
- Category
- C++
- Title
- c++ stack
- Category
- C++
- Title
- how to make string get spaces c++
- Category
- C++
- Title
- cs1955 unity vector3
- Category
- C++
- Title
- nan c++ example
- Category
- C++