PROGRAM TO CALCULATE FACTORIAL OF A NUMBER

/*PROGRAM TO CALCULATE FACTORIAL OF A NUMBER*/ #include<conio.h> #include<iostream.h> class factorial { int f,n,i; public: void input(); void output(); }; void factorial::input() { cout<<“Enter any positive number: “; cin>>n; } …

PROGRAM TO PRINT SUM OF N NATURAL NUMBERS

/*PROGRAM TO PRINT SUM OF N NATURAL NUMBERS*/ #include<conio.h> #include<iostream.h> class natural { int i,sum,n; public: void process(); }; void natural::process() { cout<<“Enter any natural number: “; cin>>n; sum=0; cout<<“Natural …

PROGRAM TO PRINT A PATTERN – 4

/*PROGRAM TO PRINT A PATTERN – 4*/ #include<conio.h> #include<iostream.h> class pattern { int i,j,n,count; public: void process(); }; void pattern::process() { cout<<“Enter the limit of rows(in odd numbers): “; cin>>n; …

PROGRAM TO PRINT A PATTERN – 3

/*PROGRAM TO PRINT A PATTERN – 3*/ #include<conio.h> #include<iostream.h> class pattern { int i,j,n,count; public: void process(); }; void pattern::process() { cout<<“Enter the limit of rows: “; cin>>n; cout<<“\nPattern is:\n\n”; …

PROGRAM TO PRINT PATTERNS USING SWITCH CASE

/*PROGRAM TO PRINT PATTERNS USING SWITCH CASE*/ #include<conio.h> #include<iostream.h> class patterns { int n,i,j,k,l; public: void choice(); void output(); }; void patterns::choice() { cout<<“Enter 1 to print left triangle pattern: …

PROGRAM TO PRINT A PATTERN – 2

/*PROGRAM TO PRINT A PATTERN – 2*/ #include<conio.h> #include<iostream.h> class pattern { int i,j,n,count,k,l; public: void process(); }; void pattern::process() { cout<<“Enter the limit of rows: “; cin>>n; count=0; for(i=1;i<=n;i++) …

PROGRAM TO PRINT A PATTERN – 1

/*PROGRAM TO PRINT A PATTERN – 1*/ #include<conio.h> #include<iostream.h> class pattern { int i,n,j; public: void input(); void display(); }; void pattern::input() { cout<<“Enter the limit of rows: “; cin>>n; …

PROGRAM OF SUM OF N NUMBERS

/*PROGRAM TO CALCULATE SUM OF N NUMBERS. IF NO. IS NEGATIVE IT SHOULD BE IGNORED AND IF ZERO THEN PROCESS SHOULD BE TERMINATED*/ #include<conio.h> #include<iostream.h> class sum_of_nos { int i,n,sum; …