Author Archives: Gangadhar Koppella

CPP05 – Write a CPP program to create Student class with appropriate constructor and destructor

Write a CPP program to create Student class with appropriate constructor and destructor. Also show what happen when you try to attempt to access private data members from outside of the class. CODE : #include<iostream.h> #include<string.h> #include<conio.h> class student { int roll; char name[25]; char addr[100]; int std; char div; long cont; public: void get_data(int,char*,char*,int,char,long);… Read More »

CPP04 – (c) Write a CPP program to generate a Fibonacci series of 50 numbers .

(c) Write a CPP program to generate a Fibonacci series of 50 numbers . CODE:- #include<iostream.h> #include<conio.h> void main() { unsigned long T,i,X=0,Y=1; clrscr(); cout<<“\nFIBONACCI 50 SERIES ARE :- \n”; i=0; while(i<50) { T=X+Y; cout<<” “<<X; X=Y; Y=T; i++; } getch(); } [codesyntax lang=”cpp”] #include<iostream.h> #include<conio.h> void main() { unsigned long T,i,X=0,Y=1; clrscr(); cout<<“\nFIBONACCI 50… Read More »

CPP04 – (b) Write a CPP program to print whether a number is prime or not .

(b) Write a CPP program to print whether a number is prime or not . CODE:- #include<iostream.h> #include<conio.h> void main() { int NUM,I; clrscr(); cout<<“ENTER A NUMBER :”; cin>>NUM; for(I=2;I<NUM;I++) { if(NUM%I==0) break; } if(I==NUM) cout<<NUM<<” IS A PRIME NUMBER”<<endl; else cout<<NUM<<” IS NOT A PRIME NUMBER”<<endl; getch(); } [codesyntax lang=”cpp”] #include<iostream.h> #include<conio.h> void main()… Read More »

CPP04 – (a) Write a CPP program to print the factorial of a given number.

(a) Write a CPP program to print the factorial of a given number. CODE:- #include<iostream.h> #include<conio.h> void main() { int i,num; long fact=1; clrscr(); cout<<“Enter Number : “; cin>>num; for(i=num;i>0;i–) { fact=fact*i; } cout<<“Factorial = “<<fact<<endl; getch(); } [codesyntax lang=”cpp”] #include<iostream.h> #include<conio.h> void main() {   int i,num;   long fact=1;   clrscr();   cout<<“Enter… Read More »

CPP03 – Write a CPP program to find the maximum marks, average-marks and minimum marks obtained by a study in five papers given

Write a CPP program to find the maximum marks, average-marks and minimum marks obtained by a study in five papers as given below: Paper 1            Paper 2            Paper 3            Paper 4            Paper 5 Marks              50                    70                    65                    80                    56 CODE:- #include<iostream.h> #include<conio.h> void main() { int… Read More »

CPP02 – Write a CPP program to explain the use of for loop, while loop, switch-case, break and continue statements.

CPP02 – Write a C++ program to explain the use of for loop, while loop, switch-case, break and continue statements. CODE:- #include<iostream.h> #include<conio.h> void main() { int i; clrscr(); cout<<“FOR LOOP”<<endl; for(i=1;i<6;i++) cout<<i<<endl; cout<<“WHILE LOOP”<<endl; while(i>1) cout<<–i<<endl; cout<<“DO WHILE LOOP”<<endl; do { cout<<i++<<endl; }while(i<6); getch(); } [codesyntax lang=”cpp”] #include<iostream.h> #include<conio.h> void main() {  int i;… Read More »

CPP01- Write a CPP program to find size and print the all basic data types of C++.

Write a CPP program to find size and print the all basic data types of C++. CODE:- #include<iostream.h> #include<conio.h> void main() { char c=’c’; int i=123; short s=12; long l=98775345; float f=456.789; double d=12345.6789; clrscr(); cout << “Value of char   : ” << c << endl; cout << “Value of int    : ” << i… Read More »

Write a C program to perform the following operation on matrices D = A + (B * C), where A, B and C are matrices of (3 X 3) size and D is the resultant matrix – IGNOU MCA Assignment 2018 – 19

MASTER OF COMPUTER APPLICATIONS Course Code: MCS-011 Course Title : Problem Solving and Programming Assignment Number : MCA(1)/011/Assign/2018-19 Maximum Marks : 100 Write a C program to perform the following operation on matrices D = A + (B * C), where A, B and C are matrices of (3 X 3) size and D is the resultant… Read More »

Write an algorithm and its corresponding C program to generate students’ Progress-Report for VIII standard of a CBSE school for all its 4 terms – IGNOU MCA Assignment 2018 – 19

MASTER OF COMPUTER APPLICATIONS Course Code: MCS-011 Course Title : Problem Solving and Programming Assignment Number : MCA(1)/011/Assign/2018-19 Maximum Marks : 100 Write an algorithm and its corresponding C program to generate students’ Progress-Report for VIII standard (section of 20 students) of a CBSE school for all its 4 terms. Use Structures concept. Assumptions can… Read More »

A C program to convert decimal number to hexadecimal number – IGNOU MCA Assignment 2018 – 19

MASTER OF COMPUTER APPLICATIONS Course Code: MCS-011 Course Title : Problem Solving and Programming Assignment Number : MCA(1)/011/Assign/2018-19 Maximum Marks : 100 Write an algorithm, draw a flow chart and write its corresponding C program to convert a decimal number to its equivalent hexadecimal number – IGNOU MCA Assignment 2018 – 19 Program: #include<stdio.h> void… Read More »