programa para saber si un numero es primo
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(){
long long x;
cin>>x;
if(Is_Prime(x))cout<<"Is Prime";
else cout<<"Is not Prime";
}
Also in C++:
- Title
- how to show c++ binary files in sublime text
- Category
- C++
- Title
- c++ allocate dynamic with initial values
- Category
- C++
- Title
- C++ cin cout
- Category
- C++
- Title
- c++ string contains
- Category
- C++
- Title
- initialize array c++
- Category
- C++
- Title
- initialise 2d vector in c++
- Category
- C++
- Title
- built in function in c++ for binary to decimal
- Category
- C++
- Title
- iterative inorder traversal
- Category
- C++
- Title
- 2d vector
- Category
- C++
- Title
- time conversion hackerrank solution in c++
- Category
- C++
- Title
- how to get the prime number in c++ where time complexity is 0(log n)
- Category
- C++
- Title
- array sort c++
- Category
- C++
- Title
- C++ w3schools
- Category
- C++
- Title
- heap sort
- Category
- C++
- Title
- how to hide ui elements unity
- Category
- C++
- Title
- gfg bottom view of tree
- Category
- C++
- Title
- c++ iterate over vector
- Category
- C++
- Title
- ternary search c++
- Category
- C++
- Title
- initialization list c++
- Category
- C++
- Title
- array 2d to 1d
- Category
- C++
- Title
- c++ delete printed characters
- Category
- C++
- Title
- heredar constructor c++
- Category
- C++
- Title
- vertical traversal of binary tree
- Category
- C++
- Title
- what is atoi in strinf
- Category
- C++
- Title
- minmax_element c++
- Category
- C++
- Title
- c++ sort array of ints
- Category
- C++
- Title
- sfml base program
- Category
- C++
- Title
- cannot jump from switch statement to this case label c++
- Category
- C++
- Title
- Runtime Error: Runtime ErrorFloating-point exception (SIGFPE
- Category
- C++
- Title
- int max in c++
- Category
- C++
- Title
- mao two drivers c++
- Category
- C++
- Title
- double to float c++
- Category
- C++
- Title
- find number of 1s in a binary cv::mat image
- Category
- C++
- Title
- maximum possible number atmost k swaps
- Category
- C++
- Title
- invalid types int int for array subscript c++
- Category
- C++
- Title
- vector initialization c++
- Category
- C++
- Title
- elseif c++
- Category
- C++
- Title
- find all the palindrome substring in a given string
- Category
- C++
- Title
- how are graphics in games made
- Category
- C++
- Title
- using namespace std in c++
- Category
- C++
- Title
- ternary operator c++
- Category
- C++
- Title
- function declerations in C++
- Category
- C++
- Title
- how to make a switch case statement in c++
- Category
- C++
- Title
- reverse a linked list using recursion
- Category
- C++
- Title
- templates of templates c++
- Category
- C++
- Title
- c++ write new file
- Category
- C++
- Title
- pass by reference c++
- Category
- C++
- Title
- correct sequence of compilation process in c++
- Category
- C++
- Title
- linkedlist implementation in c++
- Category
- C++
- Title
- coping 2d vector in cpp
- Category
- C++
- Title
- c++ return multiple values
- Category
- C++
- Title
- how to sort a vector in reverse c++
- Category
- C++
- Title
- euler's totient function c++
- Category
- C++
- Title
- what is difference between single inverted and double inverted in programming languages
- Category
- C++
- Title
- unordered_map c++
- Category
- C++
- Title
- c++ remove space from string
- Category
- C++
- Title
- time function c++
- Category
- C++
- Title
- monotonic deque
- Category
- C++
- Title
- cs1955 unity vector3
- Category
- C++
- Title
- how initilaize deffult value to c++ class
- Category
- C++
- Title
- subtracting two large numbers
- Category
- C++
- Title
- initialize vector of vector c++
- Category
- C++
- Title
- peak in c++
- Category
- C++
- Title
- cut by delimiter c++
- Category
- C++
- Title
- foind th output c++
- Category
- C++
- Title
- c++ create array
- Category
- C++
- Title
- find upper bound c++ vector
- Category
- C++
- Title
- matrix transpose tiling
- Category
- C++
- Title
- jump to case label c++
- Category
- C++
- Title
- setbits
- Category
- C++
- Title
- size of a matrix c++
- Category
- C++
- Title
- c++ over load oprator to print variable of clas
- Category
- C++
- Title
- kruskal c++
- Category
- C++
- Title
- how to calculate inverse trigonometric values in c++
- Category
- C++
- Title
- how to put a class in a .h file c++
- Category
- C++
- Title
- set c++
- Category
- C++
- Title
- how to input multiple lines of a file in c++
- Category
- C++
- Title
- runtime array size c++
- Category
- C++
- Title
- gfg right view of tree
- Category
- C++
- Title
- how to use winmain function
- Category
- C++
- Title
- c++ dereference a pointer
- Category
- C++
- Title
- spicoli
- Category
- C++
- Title
- c++ default constructor remove
- Category
- C++
- Title
- how to make string get spaces c++
- Category
- C++
- Title
- c++ stream string into fiel
- Category
- C++
- Title
- Find the minimum difference between pairs in a simple path of tree C++
- Category
- C++
- Title
- find in string c++
- Category
- C++
- Title
- how to take input in C++ in coding
- Category
- C++
- Title
- formal parameter c++
- Category
- C++
- Title
- declaring vector c++
- Category
- C++
- Title
- log base e synthax c++
- Category
- C++
- Title
- how to remove maximum number of characters in c++ cin,ignore
- Category
- C++
- Title
- calling by reference c++
- Category
- C++
- Title
- screen record ios simulator
- Category
- C++
- Title
- file reading c++
- Category
- C++
- Title
- command line options in c++
- Category
- C++
- Title
- tokenize string c++
- Category
- C++
- Title
- c++ declare variable
- Category
- C++
- Title
- how to reverse a vector
- Category
- C++
- Title
- c++ sort
- Category
- C++