NEWS

Search This Blog

Thursday, 16 November 2017

12th computer science practical book english medium

                 12th computer science practical book English medium

1.    FIBONACCI SERIES

 #include<iostream.h>
#include<conio.h>
void main()
{
int x1= -1,x2=1,x3,n;
clrscr();
cout<<”\n Enter the number of terms.. “;
cin>>n;
for(int i=0;i<n;i++)
{

x3=x1+x2;
cout<<”\n “<<x3;
x1=x2;
x2=x3;
}
getch();
}
Output:
Enter the number of terms…10
0
1
1
2
3
5
8
13
21
34






2.FACTORIAL OF A NUMBER – USING FUNCTION
#include<iostream.h>
#include<conio.h>
long int fact(int x)
{
long int f=1,i;
for(i=1;i<=x;i++)
f=f*i;
return(f)
}
void main()
{
int n;
clrscr();
cout<<”\n Enter the number…”;
cin>>n;
cout<<”\n The Factorial of  the number“<<fact(n);
getch();
}
Output:
   Enter the number….3
   The Factorial of the number…6
  






  






3. NUMBER IN WORDS –USING SWITCH

#include<iostream.h>
#include<conio.h>
void main()
{
int n;
clrscr();
cout<<”Enter the number ..\n“;
cin>>n;
switch(n)
{
case 1: cout<<”one”; break;
case 2: cout<<”two”; break;
case 3: cout<<”three”;break;
case 4: cout<<”four”;break;
case 5: cout<<”five”; break;
case 6: cout<<”six”; break;
case 7: cout<<”seven”;break;
case 8: cout<<”eight”; break;
case 9: cout<<”nine”;break;
default :cout<<”Invalid number”;
}
getch();
}
     Output:
Enter the number ..2
Two
Enter the number..10
Invalid number


4. PALINDROME
 #include<iostream.h>
#include<conio.h>
#include<string.h>
Void main()
{
char a[10],b[10];
clrscr();
cout<<”Enter the string…”;
cin>>a;
strcpy(b,a)
strrev(b);
if(strcmp(a,b)==0)
cout<<”palindrome”;
else
cout<<”not palindrome”;
getch();
}
Output:
Enter the string…MADAM
Palindrome

Enter the string… INDIAN
not palindrome




5. NUMBER OF ODD AND EVEN NUMBER
#include<iostream.h>
#include<conio.h>
  void main()
{
clrscr();
int x[50], n, odd=0,even=0;
cout<<”\n Enter the number of values…”;
cin>>n;
for(int i=0; i<n; i++)
{
cout<<”\n Enter the values…….”;
cin>>x[i];
if(x[i]%2 = =0)
++even;
else
++odd;
}
cout<<”\n number of odd numbers...:”<<odd;
cout<<”\n number of even numbers…:”<<even;
getch();
}

Output:
   Enter the number of values…5
  1
  2
  3
  4
  5
 number of odd numbers…3
 number of even numbers…2




 6. TRANSPOSE OF 3X3 MATRIX

#include<iostream.h>
#include<conio.h>
  void main()
{
clrscr();

int a[3][3],i,j;

cout<<”Enter the 3x3 Matrix elements……\n”;
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
cin>>a[i][j];
}
}
cout<<”Transpose of 3x3 Matrix elements …….\n “;
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
cout<<a[j][i]<<’\t’;
}
Cout<<”\n”;
}
getch();
}

Output:
Enter the 3x3 Matrix elements……
1       2      3
1       2      3
1       2      3
Transpose of 3x3 Matrix elements ……

1       1       1
2       2       2

3       3       3






click here to download pdf






keywords:

12th computer practical book pdf
12th computer application practical book pdf
12th computer science practical manual
hsslive computer science lab
hsslive computer science practical
12th computer science practical book english medium
plus two computer application practical questions
12th computer science practical book winny
plus two computer science practical book
12th std computer science practical book english medium
12th computer science practical book english medium
12th computer science practical book in english
hsc computer science practical book pdf
12th computer science practical manual english medium
12th computer science practical book pdf english medium download
12th computer science practical file
12th computer application practical book pdf

ADSENCE ADD