Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions C++/Program 26/PrimeNo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include<iostream>
using namespace std;
int main(){
int n,k=0;
cout<<"Check the no is prime or not"<<endl;
cin>>n;
for(int i=1;i<=n;i++){
if(n%i==0){
k++;
}
}
if(k==2){
cout<<"No. is Prime";
}
else{
cout<<"No. is not prime";
}

return 0;
}
7 changes: 7 additions & 0 deletions C++/Program 26/ReadMe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Program to check whether the no. is prime or not

Input: 6
Output: No. is not prime

Input: 5
Output: No. is prime
1 change: 1 addition & 0 deletions C++/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

| Program No.| Question |
| ------- | ------ |

| [Program-01](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C++/Program-01/Program.cpp) | Program to find the maximum and minimum element in an array. |
| [Program-02](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C++/Program-2/number_of_occurrence.cpp) | Program to find the number of occurrence of X element present in sorted array. |
| [Program-03](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C++/Program-3/program.cpp) | Program to Swap the Kth Elements of a series. |
Expand Down