Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Name: M.

Bashar Program: ADP – CS


Roll no: 003 Semester: 2nd -Blue
Course: OOP Instructor: Sir Faheem

ASSIGNMENT # 04
File name: Momin.h
Input:
#include<iostream>

using namespace std;

struct factorial

int f,c,n;

void fact()

f=1 , c=0 ;

cout<<”Enter any number: ”;

cin>>n;

for(int i=n; i>=1; i--)

f=f*i;

for(int j=n; j>=1; j--)

c=c+j;

cout<<”The factorial of ”<<n<<” is ”<<f<<”\n”;

cout<<”The addition of ”<<n<<” is ”<<c<<”\n”;

};
Second file:
Input:
#include<iostream>

#include” Momin.h ”

using namespace std;

class calculus

public:

factorial f;

calculus()

f.fact:

};

main()

{
calculus c;

Outputs:

You might also like