Skip to content
Open
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
34 changes: 24 additions & 10 deletions labtest.cpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,34 @@
#include<bits/stdc++.h>
using namespace std;
//write a user defined function to find first N prime numbers;
//the function should be named like : youname_yourid;

/*
example:
// user defined function to find first N prime numbers
// rename this function as: yourname_yourid
void yourname_yourid(int n){
int count = 0;
int num = 2;

void nishat_90(int n){
//your code here;
while(count < n){
bool isPrime = true;

for(int i = 2; i * i <= num; i++){
if(num % i == 0){
isPrime = false;
break;
}
}
count++;
}
num++;
}
cout << endl;
}
*/

int main(){
int n;
cout << "Enter the number n" << endl;
cin >> n;

yourname_yourid(n);

int n;
cout<<"Enter the number n"<<endl;
cin>>n;
return 0;
}