Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
814a1e6
Merge pull request #314 from swaaz/hacktoberfest
swaaz Oct 5, 2021
7803448
Updated C++ README.md
NamanManjkhola Oct 6, 2021
3dfa926
Updated Dart README.md
NamanManjkhola Oct 6, 2021
b1916a8
Corrected mistake in Update Dart README
NamanManjkhola Oct 6, 2021
6425d09
Created Java Readme.md
NamanManjkhola Oct 6, 2021
5cf3fa1
Created Javascript README.md
NamanManjkhola Oct 6, 2021
9b87164
Created Kotlin README.md
NamanManjkhola Oct 6, 2021
dba275a
Updated README with links of programs
Bibekdhkl Oct 6, 2021
bd296c1
Updated C README.md
NamanManjkhola Oct 6, 2021
4606353
Updated python README.md
NamanManjkhola Oct 6, 2021
1709cdc
Program 26 - Prime No. Program in C++
Akash2790 Oct 6, 2021
7725733
Program 26 - Added a readme file with I/O
Akash2790 Oct 6, 2021
9abf4f6
Updated Readme in C++ Folder
Akash2790 Oct 6, 2021
0cbc2a8
Create StacksUsingLL.cpp
HemanthKumar8251 Oct 6, 2021
fb73da4
Add files via upload
HemanthKumar8251 Oct 6, 2021
481777a
Update README.md
HemanthKumar8251 Oct 6, 2021
77458dd
Update README.md
HemanthKumar8251 Oct 6, 2021
5103a4d
Update README.md
HemanthKumar8251 Oct 6, 2021
1a24dc2
Create Polynomial_Expression.cpp
HemanthKumar8251 Oct 6, 2021
5f159c5
Add files via upload
HemanthKumar8251 Oct 6, 2021
9629ed0
Merge pull request #315 from Bibekdhkl/master
swaaz Oct 7, 2021
4067e5f
Merge branch 'master' into hacktoberfest
swaaz Oct 7, 2021
14635df
Merge pull request #316 from NamanManjkhola/hacktoberfest
swaaz Oct 7, 2021
37b1589
Merge branch 'master' into master
swaaz Oct 7, 2021
a519460
Merge pull request #318 from Akash2790/master
swaaz Oct 7, 2021
6ef9ca1
Merge branch 'master' into master
swaaz Oct 7, 2021
9597275
Merge pull request #319 from HemanthKumar8251/master
swaaz Oct 7, 2021
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++/Program_26/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Program to implement Stack DataStructure Using Linked Lists
73 changes: 73 additions & 0 deletions C++/Program_26/StacksUsingLL.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
//Stacks Using Linked_Lists
#include<iostream>
using namespace std;
class node{
public:
int data;
node *link;
}*top=NULL;

void push(int x){
node *t;
t = new node;
if(t==NULL){
cout<<"Stack is full[Satck overflow]"<<endl;
}
else{
t->data = x;
t->link = top;
top = t;
}
}

void display(node *p){
while(p){
cout<<p->data<<" ";
p = p->link;
}
cout<<endl;
}

int pop(){
node *p = top;
int x;
if(top==NULL)
cout<<"Stack is empty![Stack Underflow]"<<endl;
else{
top = p->link;
x = p->data;
delete p;
}
return x;

}

int main(){

int x;
char c;
while(1){
cout<<"Choose an Operation : \n1.Push\n2.Pop\n3.Display\n4.Exit"<<endl;
cin>>c;
switch (c)
{
case '1':
cout<<"Enter the element : ";
cin>>x;
push(x);
break;
case '2':
x=pop();
cout<<"Poped element is "<<x<<endl;
break;
case '3':
display(top);
break;
case '4':
return 0;
break;
}
}

return 0;
}
50 changes: 50 additions & 0 deletions C++/Program_27/Polynomial_Expression.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
//Polynomial Expressions
#include<bits/stdc++.h>
using namespace std;
class node{
public:
int c;
int e;
node *link;
}*P=NULL;

void create(){
node *last,*t;
int n;
cout<<"Enter the NUmber of Terms : ";
cin>>n;
cout<<"Enter all the Terms in coeffient and exponent form : "<<endl;
for(int i=0;i<n;i++){
t = new node;
cin >> t->c >> t->e;
t->link = NULL;
if(P==NULL)
last = P = t;
else{
last->link = t;
last = t;
}
}

}

double evalute(int x){
node *t = P;
double sum = 0.0;
while(t){
sum += t->c*pow(x,t->e);
t = t->link;
}
return sum;
}

int main(){
int n;
create();
cout<<"Enter the Value of x : ";
cin>>n;
double r = evalute(n);
cout<<"The value of the polynomial expression when x = "<<n<<" is "<<r;

return 0;
}
1 change: 1 addition & 0 deletions C++/Program_27/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Program to evaluate polynomial expression Using Linked Lists
50 changes: 35 additions & 15 deletions C++/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,37 @@
<div align="center">

# C++ Programs

| Program No.| Question |
| ------- | ------ |
| Program-01 | Program to find the maximum and minimum element in an array. |
| Program-02 | Program to find the number of occurrence of X element present in sorted array. |
| Program-03 | Program to Swap the Kth Elements of a series. |
| Program-04 | Program to find factorial of a number |
| Program-05 | Program to find the sum of the digits of the given number. |
| Program-06 | Program to find the greatest common divisor of two number. |
| Program-07 | Program to print Pascal' triangle |
| Program-08 | Program to reverse a string |
| Program-09 | Program to check if two numbers are equal without using arithmetic operators or comparison operators.
| Program-10 | Program to Reverse words in a given string
| Program-10 | Program to find the missing number in a Sorted Array.
| Program-15 | Program to find modular exponentiation.
| Program-19| To check whether a number is in palindrome or not
| Program-24 | Program to convert Hexa-Decimal number to Decimal number
| Program-25 | Program to Implement Queue Data Structure Using Linked Lists



| [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. |
| [Program-04](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C++/Program-4/program.cpp) | Program to find factorial of a number |
| [Program-05](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C++/Program-5/program.cpp) | Program to find the sum of the digits of the given number. |
| [Program-06](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C++/Program-6/program.cpp) | Program to find the greatest common divisor of two number. |
| [Program-07](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C++/Program-7/program.cpp) | Program to print Pascal' triangle |
| [Program-08](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C++/Program-8/program.cpp) | Program to reverse a string |
| [Program-09](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C++/Program-9/program.cpp) | Program to check if two numbers are equal without using arithmetic operators or comparison operators.
| [Program-10](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C++/Program-10/program.cpp) | Program to find the missing number in a Sorted Array.
| [Program-11](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C++/Program11/Program11.cpp) | Program to Camel case an input sentence |
| [Program-12](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C++/Program-12/program.cpp) | Find the First non repeating character index
| [Program-13](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C++/Program-13/program.cpp) | Find the longest Palindromic Substring |
| [Program-14](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C++/Program-14/program.cpp) | Find the Maximum Product of the Subarray |
| [Program-15](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C++/Program-15/program.cpp) | Program to find modular exponentiation. |
| [Program-16](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C++/Program-16/rightangle.cpp) | Program for right angled patterns |
| [Program-17](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C++/Program-17/randomcolorscreen.cpp) | Program to print random texts with colour |
| [Program-18](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C++/Program-18/getWeekday.cpp) | Program to get weekday with given day. |
| [Program-19](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C++/program-19/palindrome.cpp) | To check whether a number is in palindrome or not |
| [Program-20](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C++/Program-20/program.cpp) | To find the square root of a number upto "p" no of places |
| [Program-21](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C++/Program-21/program.cpp) | Last digit of sum of partial Fibonacci Series |
| [Program-22](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C++/Program%2022/adding_two_string.cpp) | Program to add Two Binary Number Input |
| [Program-23](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C++/Program%2023/sum_of_square_of_binomial_coefficient.cpp) | To find the sum of square of binomial coefficient Input(integer input) |
| [Program-24](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C++/Program_24/HexaDecimal-Decimal.cpp) | Program to convert Hexa-Decimal number to Decimal number
| [Program-25](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C++/Program_25/Queues_Using_Linked_Lists.cpp) | Program to Implement Queue Data Structure Using Linked Lists

</div>
<hr>
Loading