programfile.doc.docx

49
Computer Science Program File Name – Aman Gupta

Upload: amangupta

Post on 15-Sep-2015

216 views

Category:

Documents


2 download

TRANSCRIPT

Computer ScienceProgram FileName Aman Gupta

Acknowledgement

I am greatly indebted to our teacher Ms.Urvashi who throughout the tedious process of completion of the programs displayed with full patience and helped me tide over the obstacles faced during this course by providing me with the necessary counseling and encouragement at each step and pointed out my various shortcomings in tackling these programs.

Student sign. Ms. UrvashiName- (HOD computers)

CONTENTS

Q1 Write a menu-driven program to check whether the number is 1. Palindrome or not.2. Even or odd.

Q2 Write a menu-driven program to check whether the number is 1. Prime or composite.2. Armstrong or not.

Q3Write a C++ program to accept year and check if it is a leap year or not.

Q4Write a C++ program to generate Fibonacci series.

Q5Write a C++ program to generate the following patternAABABCABCDABCDE

Q6Write a menu-driven program to perform the following operations on two matrices1. Addition of matrices2. Subtraction of matrices3. Multiplication of matrices

Q7 Write a menu-driven program to perform the following operations on single matrix1. Display upper triangular part of matrix2. Display lower triangular part of matrix3. Transpose of matrix

Q8 Write a menu-driven program to display the following from single matrix1. Maximum element.2. Minimum element.3. Average of elements.

Q9Write a menu-driven program to perform the following operations in a string according to users choice1. Count number of vowels2. Count number of consonants3. Count number of digits4. Count number of special characters

Q10Write a menu-driven program to perform the following operation in 1-D character array.1. Uppercase to lowercase 2. Lowercase to uppercase3. Reverse a string

Q11Write a C++ program to concatenate two strings into third array.

Q12Write a C++ program to find factorial of a number using function recursion.

Q13Write a C++ program that invokes a function calc( ) which intakes two integers and an arithmetic operator and prints the corresponding result.

Q14.Write a C++ program to maintain information rollno, marks in two subjects and grade about students and display them merit order wise using structure.

Q15.Write a C++ program to accept and display an employee record empno, name, designation and department through structures.

/*Write a menu-driven program to check whether the number is 1. Palindrome or not 2.Even or odd */

#include#include void main() { clrscr(); int n, num, digit, rev = 0,choice; cout > num; n = num; cout