Skip to content

Instantly share code, notes, and snippets.

View ravikiran0606's full-sized avatar
🎯
Focusing

Ravi Kiran Selvam ravikiran0606

🎯
Focusing
View GitHub Profile
@ravikiran0606
ravikiran0606 / stlmap.cpp
Created August 21, 2016 08:45
C++ Program to implement the use of STL Map:
#include<iostream>
#include<map>
// Used to store key value pairs. (Eg: To maintain Phone Book )
using namespace std;
int main()
{
map<string,long long>phonebook;
@ravikiran0606
ravikiran0606 / stlvector.cpp
Created August 21, 2016 08:43
C++ Program to implement the use of STL vector :
#include<iostream>
#include<vector>
// Similar to array but useful when the number of elements (size) is unknown...
using namespace std;
int main()
{
vector<int>v;
@ravikiran0606
ravikiran0606 / Virtualfunctions.cpp
Created July 31, 2016 10:41
C++ program to implement the use of Virtual functions and Pure Virtual functions:
#include<iostream>
using namespace std;
class media{ // Abstract Class...
protected:
string bookname,authorname,authornativelang;
int bookISBN;
public:
virtual void display(); // Virtual function...
#include<iostream>
#define maxi 100
using namespace std;
int flag;
float add(float a,float b){
return (a+b);
}
@ravikiran0606
ravikiran0606 / NestedClass.cpp
Last active July 31, 2016 09:12
C++ program to implement the initialization of Nested Members in a class:
#include<iostream>
using namespace std;
class first{
int fa,fb;
public:
first();
first(int x,int y);
@ravikiran0606
ravikiran0606 / TypeConversion.cpp
Last active July 31, 2016 08:51
C++ Program to implement the Type Conversion in Classes:
#include<iostream>
using namespace std;
class duration{
int mi;
public:
duration();
duration(int t);
@ravikiran0606
ravikiran0606 / Arrayofobj.cpp
Last active July 31, 2016 08:48
C++ program to implement the array of objects and pointer pointing to it:
#include<iostream>
#include<string>
using namespace std;
class student{
string name;
int rollno;
public:
#include<bits/stdc++.h>
using namespace std;
int main()
{
long int n,q,x,i,ans;
char ch;
cin>>n>>q;
int a[n]={0};
#include<bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t;
#include<bits/stdc++.h>
#define maxi 10000007
using namespace std;
int isprime[maxi],a[maxi],prmcnt[maxi];
void sieve(){
fill_n(isprime,maxi,1);
int i,j;