computer practicals

  • View
    214

  • Download
    0

Embed Size (px)

DESCRIPTION

all c++ programs for class xii cbse

Text of computer practicals

INDEXS.NoProgramPage No.

1Program to show average marks of 6 students using 1-D Array

2Program to search an element of an array using Linear search method

3Program to search an element of an array using Binary search

4Program to sort an array in ascending order using Selection sort

5Program to sort the given array in ascending order using bubble sort method.

6Program to merge the contents of two sorted arrays A & B into third array C. Where array A is sorted in ascending order, B is sorted in descending order; the resultant array is in ascending order.

7Program to insert an element into Array

8Program to delete an element into Array

9A menu drive program to perform basic operations on the two complex numbers using structures

10A menu drive program for number conversion (User defined).

11A menu drive program to Implement STACK as an array

12A menu drive program to implement stack as a linked list

13A Menu drive program to implement queue as an array

14Menu drive program to implement Queue as a linked list

15Program to create a text file(.txt) and display number of words, alphabets, vowels and consonants and number of lowercase and uppercase letters using the concept of DATA FILE HANDLING.

16Program to read a text file and create a duplicate file by toggling the characters using the concept of data file handling

17Program to create a text file to input roll no. and marks of ten students and display them on screen after reading from the text file, using data file handling

18Program to read file sports.dat and copy only those records where event name is ATHLETIC using the concept of Data file handling

19Program to print and find the sum of Fibonacci series using recursion

20Program to print and find the sum of even /odd numbers using recursion

21Program to find the smallest and the largest element in a dynamically created array using pointers

22Program to swap two integers using pointers

23Program to find the length of a string and print the reversed string using pointers

//Program to show average marks of 6 students using 1-D Array#include #includevoid main(){int i;float mark[6];cout mark[i];}float sum=0;for(i=0;i "; cin>>b[i];}ofstream student;student.open("stud.txt");for(i=0; i 99Marks of roll no. 10 => 91Marks of roll no. 12 => 89

/* Program to read file sports.dat and copy only those records where event name is ATHLETIC using the concept of Data file handling */

#include#include#include#include#includestruct sports { char event[20]; char participants[10][30]; int no_of_participants;} s[20], s2[20];

void copy(fstream &ob);int i=0;void main(){clrscr();char choice;fstream ob("sports.dat",ios::binary|ios::in|ios::out);do{if(i>0)cin.get();cout