Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
e32282d
Merge pull request #223 from swaaz/hacktoberfest
swaaz Oct 14, 2020
80b0189
Merge pull request #225 from swaaz/hacktoberfest
swaaz Oct 14, 2020
a2e79a1
Merge pull request #227 from swaaz/hacktoberfest
swaaz Oct 14, 2020
2553a75
Add files via upload
Arceus-sj Oct 15, 2020
cf8f562
Create Readme.md
Arceus-sj Oct 15, 2020
3137892
Rename C++/PrintSeries.cpp to C++/Program18/PrintSeries.cpp
Arceus-sj Oct 15, 2020
2561c65
Read me
Mayanksingla139 Oct 15, 2020
f32c130
Merge pull request #1 from Mayanksingla139/Mayanksingla139-patch-1
Mayanksingla139 Oct 15, 2020
cca9858
Delete program-19
Mayanksingla139 Oct 15, 2020
e731e41
Update readme.md
swaaz Oct 15, 2020
e60c038
Merge pull request #228 from Arceus-sj/master
swaaz Oct 15, 2020
3dec886
To check whether a number is in palindrome or not
Mayanksingla139 Oct 16, 2020
e9b593f
Merge pull request #229 from Mayanksingla139/Mayanksingla139
swaaz Oct 16, 2020
419d1e1
Update README.md
Shravyarshetty Oct 16, 2020
340cc4b
Merge pull request #230 from Shravyarshetty/master
swaaz Oct 16, 2020
28a6bac
Update README.md
Shravyarshetty Oct 16, 2020
64ab4b3
Merge pull request #231 from Shravyarshetty/master
swaaz Oct 16, 2020
8c2efab
Update README.md
Shravyarshetty Oct 16, 2020
2ba1153
Merge pull request #232 from Shravyarshetty/master
swaaz Oct 16, 2020
b56d4d4
Create square_root_using_binary_search.cpp
Sitispeaks Oct 17, 2020
1ab5108
Create Readme.md
Sitispeaks Oct 17, 2020
2073756
Rename square_root_using_binary_search.cpp to program.cpp
Sitispeaks Oct 17, 2020
136155c
Update and rename Readme.md to README.md
Sitispeaks Oct 17, 2020
5e1fde8
Merge pull request #233 from Sitispeaks/master
swaaz Oct 17, 2020
be79008
A program in Dart
your-name123 Oct 18, 2020
b43f37f
Create README.md
AK1406 Oct 18, 2020
b6503a5
Merge pull request #234 from Anju1415/dart
swaaz Oct 19, 2020
2e74c90
Updated README.md
GowthamPB Oct 21, 2020
3562bb1
Updated readme file
GowthamPB Oct 21, 2020
eb4f4ef
Added Program 30
GowthamPB Oct 21, 2020
d3eec05
Merge pull request #235 from GowthamPB/GowthamPB-python
swaaz Oct 21, 2020
55afa9f
Added program 70 in C folder
GowthamPB Oct 21, 2020
51a18a9
Updated readme file
GowthamPB Oct 21, 2020
fe47c8a
Merge pull request #236 from GowthamPB/GowthamPB-C
swaaz Oct 22, 2020
c5feea8
Uploaded program-21
nizz009 Oct 23, 2020
cd0fb12
Update README.md
nizz009 Oct 23, 2020
b29c9cb
Merge pull request #237 from nizz009/master
swaaz Oct 23, 2020
b9265e3
Added Binary String Addition Algorithm
Oct 24, 2020
61694b4
Merge pull request #1 from b419007/Program-to-add-two-binary-Number
Oct 24, 2020
9dd036e
Added of Sum the square of Binomial Number
Oct 24, 2020
a3a84a3
Merge pull request #2 from b419007/Added-of-Sum-the-square-of-Binomia…
Oct 24, 2020
dc4ad72
Merge pull request #238 from b419007/master
swaaz Oct 24, 2020
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
59 changes: 59 additions & 0 deletions C++/Program 22/adding_two_string.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
Program : To add 2 string

this Program is Contributed by Abhishek Jaiswal
*/

#include <iostream>
using namespace std;

int Len(string &str1, string &str2)
{
int len1 = str1.size();
int len2 = str2.size();
if (len1 < len2)
{
for (int i = 0 ; i < len2 - len1 ; i++)
str1 = '0' + str1;
return len2;
}
else if (len1 > len2)
{
for (int i = 0 ; i < len1 - len2 ; i++)
str2 = '0' + str2;
}
return len1;
}

string add( string a, string b )
{
string result;
int len = Len(a, b);

int carry = 0;
for (int i = len-1 ; i >= 0 ; i--)
{
int aBit = a.at(i) - '0';
int bBit = b.at(i) - '0';
int sum = (aBit ^ bBit ^ carry)+'0';

result = (char)sum + result;
carry = (aBit & bBit) | (bBit & carry) | (aBit & carry);
}

if (carry)
result = '1' + result;

return result;
}

int main()
{
string str1,str2;
cout<<"Enter the string 1 :";
cin>>str1;
cout<<"Enter the string 2 :";
cin>>str2;
cout << "Sum is " << add(str1, str2);
return 0;
}
3 changes: 3 additions & 0 deletions C++/Program 22/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Program : To add Two Binary Number
Input : Two Number consitising of 0 and 1
Output : Number Constisting of 0 and 1
4 changes: 4 additions & 0 deletions C++/Program 23/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Program :To find the sum of square of binomial coefficient
Input : Integer
Output : Integer

32 changes: 32 additions & 0 deletions C++/Program 23/sum_of_square_of_binomial_coefficient.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
Program :To find the sum of square of
binomial coefficient.

This Program is contributed by Abhishek Jaiswal
*/
#include <bits/stdc++.h>
using namespace std;

int factorial(int begin, int end)
{
int num = 1;
for (int i = begin; i <= end; i++)
num *= i;

return num;
}

int square(int n)
{
return factorial(n + 1, 2 * n) / factorial(1, n);
}

int main()
{
int n;
cout << "Enter the number :";
cin >> n;
cout << "The Sum of Square is " << square(n) << endl;
return 0;
}

4 changes: 4 additions & 0 deletions C++/Program-20/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## To find the square root of a number upto "p" no of places


Here we take input of that number "num" and the number "p"
45 changes: 45 additions & 0 deletions C++/Program-20/program.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#include<bits/stdc++.h>
using namespace std;


float square_root(int num,int p) {
int s=0;
int e=num;
float ans=-1;
while(s<=e) {
int mid=s+e>>1; // (s+e)/2
if(mid*mid==num) {
return mid;
}
else if(mid*mid>=num) {
e=mid-1;

}
else { //as 7*7 is vey close to 50
s=mid+1;
ans=mid;
}
}

//for floating part
//brute force
float inc=0.1;
for(int i=1;i<=p;i++) {
while(ans*ans<=num) {
ans=ans+inc;
}
//when this blows up
ans=ans-inc;//comeback 1 step
inc/=10;
}
return ans;

}

int main() {
int num,p;
cin>>num;///the input number of which you want to find the square root
cin>>p;//find the square root upto "p" no of places
cout<<square_root(num,p)<<endl;
return 0;
}
26 changes: 26 additions & 0 deletions C++/Program-21/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Last digit of sum of partial Fibonacci Series

## Problem statement:
Given two non-negative integers m and n, where m <= n, find the last digit of the sum *Fm + Fm+1 + .... + Fn*

### Input:
Two non negative intergers m and n, such that m <= n.

### Output:
The last digit of the sum of Fibonacci series starting from *Fm* to *Fn*.

### Example:

*Input:*
```
3 7
```
*Output:*
```
1
```
*Explanation:*
```
𝐹3 + 𝐹4 + 𝐹5 + 𝐹6 + 𝐹7 = 2 + 3 + 5 + 8 + 13 = 31
Last digit of 31 = 1
```
37 changes: 37 additions & 0 deletions C++/Program-21/program.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/* Compute the last digit of the sum of partial Fibonacci series. (Given two non-negative integers m and n, where m <= n, find the last digit of the sum Fm + Fm+1 + .... + Fn) */

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;

void solve()
{
ll n = 0, m = 0;
int b[60] = {0, 1, 2, 4, 7, 2, 0, 3, 4, 8, 3, 2, 6, 9, 6, 6, 3, 0, 4, 5, 0, 6, 7, 4, 2, 7, 0, 8, 9, 8, 8, 7, 6, 4, 1, 6, 8, 5, 4, 0, 5, 6, 2, 9, 2, 2, 5, 8, 4, 3, 8, 2, 1, 4, 6, 1, 8, 0, 9, 0};
int i = 0, j = 0, sum = 0;

cin >> n >> m;

i = (n-1) % 60;
j = m % 60;

if(b[j] >= b[i])
{
cout << b[j] - b[i] << "\n";
}
else
{
b[j] += 10;
cout << b[j] - b[i] << "\n";
}
}

int main()
{
//for fast input output
ios_base::sync_with_stdio(false);cin.tie(NULL);

solve();

return 0;
}
27 changes: 27 additions & 0 deletions C++/Program18/PrintSeries.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include<iostream>

using namespace std;

void printSeries(int num1,int num2){
int count = 1;
int i = 1;
while(count < num1+1){
int num = (3 * i) + 2;
i++;

if((num % num2) == 0){

}else{
cout<<num<<endl;
count++;
}
}
}

int main()
{
int num1,num2;
cin>>num1>>num2;
printSeries(num1,num2);
return 0;
}
33 changes: 33 additions & 0 deletions C++/Program18/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## Problem

```bash
Write a function which prints first num1 terms of the series 3n+2 which are not multiples of num2.
```

## Take Input
```bash
Number 1(num1)
Number 2(num2)
0 < num1 < 100 & 0 < num2 < 100
```

## Sample Input

```bash
num1 = 10;
num2 = 4;
```
## Sample Output

```bash
5
11
14
17
23
26
29
35
38
41
```
1 change: 1 addition & 0 deletions C++/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
| 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
1 change: 1 addition & 0 deletions C++/program-19/Read me.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# To check whether a number is in palindrome or not
23 changes: 23 additions & 0 deletions C++/program-19/palindrome.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include <iostream>
using namespace std;
int main()
{
int num, temp, digit, rev = 0;

cout << "Enter a positive number: ";
cin >> num;
temp = num;
while (num != 0){
digit = num % 10;
rev = (rev * 10) + digit;
num = num / 10;
}
cout << "The reverse of the number is: " << rev << endl;
if (temp == rev){
cout<<"The number is a palindrome.";
}
else{
cout << "The number is not a palindrome.";
}
return 0;
}
1 change: 1 addition & 0 deletions C/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,4 @@
| Program-67 | Program to calulate all the prime between the range of numbers includes the numbers which is provided. |
| Program-68 | Program to accept 0s and 1s as input and print if it consists 3 consecutive 0s |
| Program-69 | Program to find strong number |
| Program-70 | Program to make a simple calculator |
3 changes: 3 additions & 0 deletions C/program-70/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Program 70

C program to make simple calculator
38 changes: 38 additions & 0 deletions C/program-70/program70.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#include<stdio.h>
int main()
{
char op;
float number1,number2,result;
for(int i=0; i<5;i++)
{
printf("\nEnter\n + for Addition \n - for Subtraction \n * for Multiplication \n / for Division");
printf("\nEnter the operation you want to perform\n");
scanf("%s",&op);
printf("Enter two numbers\n");
scanf("%f %f",&number1,&number2);
switch(op)
{
case'+':result=number1+number2;
printf("Sum is %f\n",result);
break;
case'-':result=number1-number2;
printf("Difference is %f\n",result);
break;
case'*':result=number1*number2;
printf("Product is %f\n",result);
break;
case'/':if(number2==0)
{
printf("Division not possible\n");
}
else
{
result=number1/number2;
printf("Quotient is %f\n",result);
}
break;
default:printf("Enter proper input\n");
}
}
return 0;
}
3 changes: 3 additions & 0 deletions Dart/Program1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Q1. Write a program to check given number is even or odd.

Ask the number from user in variable "number"
14 changes: 14 additions & 0 deletions Dart/Program1/checkevenodd.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import 'dart:io';

void main() {
int number;

print("Enter a number : ");
number = int.parse(stdin.readLineSync());

if (number.isEven) {
print("$number is an even number");
} else if (number.isOdd) {
print("$number is an odd number");
}
}
3 changes: 3 additions & 0 deletions Python/Program 30/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Program 30

Program to make a simple calculator
Loading