Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

C++ Program using Inline Function, Assignments of Data Structures and Algorithms

code chapter nine of the data structure algorithm

Typology: Assignments

2020/2021

Uploaded on 02/13/2021

tau123
tau123 🇮🇳

8 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
#include <iostream>
using namespace std;
class operation {
int a,b,add; float div;
public:
void get(); void sum();
};
inline void operation :: get() {
cout << "Enter first value:"; cin >> a;
cout << "Enter second value:"; cin >> b;
}
inline void operation :: sum() {
add = a+b;
cout << "Addition of two numbers: " << a+b << "\n";
}
int main() {
cout << "Program using inline function\n";
operation s;
s.get();
s.sum();
return 0;
}

Partial preview of the text

Download C++ Program using Inline Function and more Assignments Data Structures and Algorithms in PDF only on Docsity!

#include using namespace std; class operation { int a,b,add; float div; public: void get(); void sum(); }; inline void operation :: get() { cout << "Enter first value:"; cin >> a; cout << "Enter second value:"; cin >> b; } inline void operation :: sum() { add = a+b; cout << "Addition of two numbers: " << a+b << "\n"; } int main() { cout << "Program using inline function\n"; operation s; s.get(); s.sum(); return 0; }