Skip to content
Open

V 2 #17

Show file tree
Hide file tree
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
5 changes: 2 additions & 3 deletions DFS.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#include<bits/stdc++.h>
using namespace std;

// Graph class represents a directed graph
// using adjacency list representation

// Graph class represents a directed graph using adjacency list representation
class Graph {
int V; // No. of vertices

Expand Down
32 changes: 17 additions & 15 deletions dataabstruction.cpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
#include <iostream>
using namespace std;
class Sum
{
private: int x, y, z; // private variables are providing data abstraction in this program


class Sum{
private: int x, y, z; // private variables are providing data abstraction in this program
public:
void add()
{
cout<<"Enter two numbers: ";
cin>>x>>y;
z= x+y;
cout<<"Sum of two number is: "<<z<<endl;
}
};
void add()
{
cout<<"Enter two numbers: ";
cin>>x>>y;
z= x+y;
cout<<"Sum of two number is: "<<z<<endl;
}
};

int main()
{
Sum sm;
sm.add();
return 0;
}
Sum sm;
sm.add();
return 0;
}