primeros numeros primos
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(){
//first n prime numbers
int n;
cin>>n;
int i=1;
while(n--){
while(!Is_Prime(++i));
cout<<i<<" ";
}
}
Also in C++:
- Title
- border radius layout android xml
- Category
- C++
- Title
- C++ cin cout
- Category
- C++
- Title
- how to grab all of user input c++
- Category
- C++
- Title
- c++ throw exception
- Category
- C++
- Title
- pop_back
- Category
- C++
- Title
- first fit algorithm
- Category
- C++
- Title
- primos menores que
- Category
- C++
- Title
- c++ scanf
- Category
- C++
- Title
- recursion in cpp with reference
- Category
- C++
- Title
- how to output text in c++
- Category
- C++
- Title
- count a character in a string c++
- Category
- C++
- Title
- c++ template function
- Category
- C++
- Title
- pointer related problems dangling/wild pointers c++
- Category
- C++
- Title
- if vector contains value c++
- Category
- C++
- Title
- removing repeated characters in a string c++
- Category
- C++
- Title
- how to print nth palindrome number in c++
- Category
- C++
- Title
- array syntax in c++
- Category
- C++
- Title
- get elements of 2d array c++
- Category
- C++
- Title
- how to compare lower case character to uppercase cpp
- Category
- C++
- Title
- filling 2d array with 0 c++
- Category
- C++
- Title
- create a bitset of 1024 bits,
- Category
- C++
- Title
- c++ transform
- Category
- C++
- Title
- c++ string to integer without stoi
- Category
- C++
- Title
- calling by reference and pointers c++
- Category
- C++
- Title
- multiple words C++ in same
- Category
- C++
- Title
- c++ remove text file
- Category
- C++
- Title
- how to print eachh chars in string data type in c++
- Category
- C++
- Title
- How to find the kth smallest number in cinstant space
- Category
- C++
- Title
- c++ stack
- Category
- C++
- Title
- find_if c++
- Category
- C++
- Title
- howt o initialize 3d vector in c++
- Category
- C++
- Title
- c++ while true loop
- Category
- C++
- Title
- c++ create object
- Category
- C++
- Title
- comparing strings c++
- Category
- C++
- Title
- traverse a map
- Category
- C++
- Title
- deque c++
- Category
- C++
- Title
- c++ files
- Category
- C++
- Title
- iterative preorder traversal
- Category
- C++
- Title
- c++ ternary operator
- Category
- C++
- Title
- binary representation differ in bits
- Category
- C++
- Title
- how to print for limited decimal values in c++
- Category
- C++
- Title
- c++ class template
- Category
- C++
- Title
- char **
- Category
- C++
- Title
- c++ declare char
- Category
- C++
- Title
- c++ initialization list
- Category
- C++
- Title
- building native binary with il2cpp unity
- Category
- C++
- Title
- ue4 c++ struct
- Category
- C++
- Title
- c++ how to return an empty vector
- Category
- C++
- Title
- appending a double to a string c++
- Category
- C++
- Title
- maximum subarray sum equal with K in c++
- Category
- C++
- Title
- multiset c++
- Category
- C++
- Title
- level order traversal
- Category
- C++
- Title
- c++ vector lower_bound index
- Category
- C++
- Title
- c++ delete dynamically allocated array
- Category
- C++
- Title
- heap in cpp stl
- Category
- C++
- Title
- what is time complexity of min_element()
- Category
- C++
- Title
- c++ class member initialization
- Category
- C++
- Title
- Find a element in a map C++
- Category
- C++
- Title
- create a dictionary cpp
- Category
- C++
- Title
- repeating character in c++
- Category
- C++
- Title
- cpp loop through object
- Category
- C++
- Title
- unordered_map c++ insert
- Category
- C++
- Title
- C++ int to char*
- Category
- C++
- Title
- c++ reset stream
- Category
- C++
- Title
- getline in c++
- Category
- C++
- Title
- map.erase in c++
- Category
- C++
- Title
- c++ do while loop
- Category
- C++
- Title
- Merge k sorted linked lists and return it as one sorted list.
- Category
- C++
- Title
- google pdf iframe viwer
- Category
- C++
- Title
- bfs in C++
- Category
- C++
- Title
- find height of a tree
- Category
- C++
- Title
- properties of a set c++
- Category
- C++
- Title
- string input
- Category
- C++
- Title
- set mimetype validation in mongoose
- Category
- C++
- Title
- c++ program for addition of two numbers using functions
- Category
- C++
- Title
- 2d vector
- Category
- C++
- Title
- object reference not set to an instance of an object c#
- Category
- C++
- Title
- iterate through unordered_map c++ in reverse order
- Category
- C++
- Title
- fail() in c++
- Category
- C++
- Title
- jump to case label c++
- Category
- C++
- Title
- double ended queue in c++ stl
- Category
- C++
- Title
- vector initialization c++
- Category
- C++
- Title
- c++ excel cell blank cells
- Category
- C++
- Title
- else if c++
- Category
- C++
- Title
- binary search in set c++
- Category
- C++
- Title
- check for bst
- Category
- C++
- Title
- root to leaf path print
- Category
- C++
- Title
- how to sort vector in c++
- Category
- C++
- Title
- how initilaize deffult value to c++ class
- Category
- C++
- Title
- C++ Syntax
- Category
- C++
- Title
- how to iterate trough a vector in c++
- Category
- C++
- Title
- mark occurances of elements in array cpp
- Category
- C++
- Title
- graph using djacency matrix c++
- Category
- C++
- Title
- count function c++
- Category
- C++
- Title
- dynamic 2d array c++
- Category
- C++
- Title
- mingw32/bin/ld.exe: C:\Users\mfrom\AppData\Local\Temp\ccSKcRks.o:PizzaPi.cpp:(.text$_ZN5PizzaC2Ev[__ZN5PizzaC2Ev]+0xa): undefined reference to `vtable for Pizza' collect2.exe: error: ld returned 1 exit status
- Category
- C++
- Title
- fast input output in c++
- Category
- C++
- Title
- c++ program for matrix addition
- Category
- C++
- Title
- how to use wasd c++
- Category
- C++
- Title
- lisy stl C++
- Category
- C++