Skip to content

Instantly share code, notes, and snippets.

View ronalddas's full-sized avatar
🎯
Focusing

Ronald Das ronalddas

🎯
Focusing
View GitHub Profile
@ronalddas
ronalddas / StringRev.cpp
Created November 8, 2015 14:15
Reversing String in C++
#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
void RevString(char a[]);
int main(void)
{
char arr[100];
@ronalddas
ronalddas / PrimeNumberRange.cpp
Created November 8, 2015 19:08
Give's List of Prime upto a certain Limit
//Prime number calculator
#include <iostream>
using namespace std;
int main(void)
{
int n=1,limit,i,j=1;
@ronalddas
ronalddas / PrimeNumberRange2.cpp
Created November 9, 2015 04:48
Takes Lower and Upper Limit and generates Prime number between them.
#include <iostream>
using namespace std;
int main(void)
{
int ul,ll,i,j,prime;
cout<<"Enter LowerL & UpperL\n";
cin>>ll>>ul;
if(ul < 2)
@ronalddas
ronalddas / Rec_Multiplication.cpp
Created November 9, 2015 05:52
Multiplication of two Numbers using Recursion
#include<iostream>
using namespace std;
int multi(int n, int m);
int main(void)
{
int x,y;
@ronalddas
ronalddas / Rec_Fibonnaci.cpp
Created November 9, 2015 05:59
Using Recursion to print first N fibonnaci Numbers
#include <iostream>
using namespace std;
int fib(int n);
int main(void)
{
int x;
cout<<"Enter x\n";
@ronalddas
ronalddas / bubblesort.cpp
Created November 9, 2015 07:21
BubbleSort
#include <iostream>
using namespace std;
void BubbleSort(int b[], int s);
int BinarySearch(int c[], int ky);
int main(void)
{
@ronalddas
ronalddas / OOP_LinearSearch.cpp
Last active November 17, 2015 04:52
A program to input, display, and search an element using linear search in an integer array using the concept of OOP
#include <iostream>
using namespace std;
class CLASSONE
{
public:
void LinearSearch(int a[],int key,int size)
{
int i,counter =0;
@ronalddas
ronalddas / OOP_RemoveDuplicate.cpp
Last active November 17, 2015 05:11
A program to input, display and remove duplicates from an integer array using the concept of OOP
#include <iostream>
using namespace std;
class CLASSONE
{
public:
void remDup(int a[],int size)
{
int i , j , k;
@ronalddas
ronalddas / SEAARASU.CPP
Last active November 22, 2015 17:57
Sereja has an array A of N positive integers : A[1], A[2], A[3], ... , A[N]. In a single operation on the array, he performs the following two steps : Pick two indices i, j s.t. A[i] > A[j] A[i] -= A[j] Sereja can apply these operations any number of times (possibly zero), such that the sum of resulting elements of the array is as small as possi…
#include <iostream>
using namespace std;
int main(void)
{
int tcn=0,sum[10],sm=0,i=0,j=0,k=0,no=0,a[100000];
//No. of tc;
do{
cin>>tcn;
@ronalddas
ronalddas / FunctionValuePass.ccp
Created December 14, 2015 14:11
Different ways of passing values to function
/*Passing Results of one function to another function
It is easy... Damn, I dont i Tinker with my code more often
I only realised this after doing Python course on Codecadmy
*/
#include <iostream>
using namespace std;
int add_Number(int a , int b)
{