11th Computer Science C Programs 2024 2025 Tamil Medium PDF Download
11th Computer Science C Programs 2024 2025 Tamil Medium PDF Download
Com
https://sites.google.com/view/tn-computer-science/home or Google Search : TN CS ONLINE EXAM
XI STD COMPUTER SCIENCE C++Programs 2024 - 2025
Sl.No Program Output
#include <iostream>
using namespace std;
int main() GOVT. HR.SEC.SCHOOL
{ MUKHASAPARUR
1. School Address cout << "\n GOVT. HR.SEC.SCHOOL ";
CUDDALORE DT
cout << "\n MUKHASAPARUR ";
cout << "\n CUDDALORE DT "; PIN 606001
cout << "\n PIN 606001" ;
}
#include <iostream>
using namespace std;
2. வ ட தி int main() Enter Radius: 8
{ The area of circle = 200.96
பர பளைவ int radius;
க டறி float area;
cout << "\n Enter Radius: ";
C++ நிர .(area cin >> radius;
of circle) area = 3.14 * radius * radius;
cout << "\n The area of circle = " << area;
}
#include <iostream>
using namespace std;
int main()
{ Enter Mark 1: 45
int m1, m2, m3, sum;
Enter Mark 2: 50
3. cout << "\n Enter Mark 1: ";
cin >> m1; Enter Mark 3: 55
ெதாைக (SUM cout << "\n Enter Mark 2: "; The sum = 150
of 3 marks) cin >> m2;
cout << "\n Enter Mark 3: ";
cin >> m3;
sum = m1 + m2 + m3;
cout << "\n The sum = " << sum;
}
#include <iostream>
using namespace std; Enter your age: 21
int main() You are eligible for
{ voting....This statement is
int age;
always executed.
4. if cout << "\n Enter your age: ";
cin >> age;
if (age >= 18)
cout<< "\n You are eligible for voting ...."; Enter your age: 17
cout << "This statement is always executed."; This statement is always
return 0; executed.
}
#include <iostream>
using namespace std;
int main() Enter a number: 54
{ The given number54 is Even
int num, rem;
cout<< "\n Enter a number: ";
cin>>num;
rem = num % 2; Enter a number: 31
5. if..else if (rem==0) The given number 31 is Odd
cout<< "\n The given number" <<num<< " is
Even";
else
cout<< "\n The given number "<<num<< " is
Odd";
return 0;
}
return 0;
}
#include <iostream>
using namespace std;
int main() {
int n, t1 = 0, t2 = 1,t3 = 0;
cout << "Enter the number of terms: ";
cin >> n;
18. ஃப ேபானாசி எ cout << "Fibonacci Series: "; Enter the number of terms: 10
வ ைச(Fibonacci series) cout << t1 << ", "; Fibonacci Series: 0, 1, 1, 2, 3, 5,
(0 1 1 2 3 5 8 …….) cout << t2 << ", "; 8, 13, 21, 34,
for (int i = 1; i <= n-2; ++i)
க டறி C++
{
நிர ஒ ைற t3= t1 + t2;
எ க. t1 = t2;
t2 = t3;
cout << t3 << ", ";
}
return 0;
}
#include<iostream>
using namespace std; Enter the Roll Number 45
30. ெபா class X Enter the Average 55.5
{ Roll number:- 45
இய நிைலய int n; Average :- 55.5
ெதாட த float avg;
public:
(Dynamic initialization X(int p,float q)
of objects) { n=p;
avg=q;
}
void disp()
{
cout<<"\n Roll number:- " <<n;
cout<<"\n Average :- "<<avg;
}
};
int main()
{
int a ; float b;
cout<<"\nEnter the Roll Number";
cin>>a;
cout<<"\nEnter the Average";
cin>>b;
X x(a,b); // dynamic initialization
x.disp();
return 0;
}
#include<iostream>
using namespace std;
class Data
{
int i, j;
public:
int k;
Data()
{
cout<<"\n Non Parametrerized Non Parametrerized constructor
constructor"; Parametrerized constructor
i=0; Copy constructor
j=0; 0 0
} 10 20
Data(int a,int b) 10 20
{
cout<<"\n Parametrerized constructor";
i=a;
j=b;
}
31. ஆ கிகள Data(Data &a)
வைகக (Types of {
constructor) cout<<"\n Copy constructor";
i=a.i;
j=a.j;
}
void display() //member function
{
cout<<"\n"<< i<<"\t"<<j;
}
};
int main()
{
Data d1,d2(10,20),d3(d2);
d1.display();
d2.display();
d3.display();
return 0;
}
#include <iostream>
using namespace std;
void print(int i)
{ It is integer 10
cout<< " It is integer " << i <<endl; It is float 10.1
It is string Ten
}
void print(double f)
{
33. ெசய cout<< " It is float " << f <<endl;}
void print(string c)
பண மி (Function
{
overloading) cout<< " It is string " << c <<endl;
}
int main()
{
print(10);
print(10.10);
print("Ten");
return 0;
}
#include<iostream>
using namespace std;
class complex
{
int real,img;
public:
void read()
{ Enter the First Complex
cout<<"\nEnter the REAL PART : "; Number
cin>>real; Enter the REAL PART : 3
cout<<"\nEnter the IMAGINARY PART : ";
cin>>img; Enter the IMAGINARY PART :
} 4
complex operator +(complex c2)
{
complex c3; Enter the Second Complex
c3.real=real+c2.real; Number
35. ெசய றி c3.img=img+c2.img; Enter the REAL PART : 5
பண மி return c3;
(operator } Enter the IMAGINARY PART :
void display() 8
overloading) {
cout<<real<<"+"<<img<<"i";
} SUM = 8+12i
};
int main()
{
complex c1,c2,c3;
int choice, cont;
cout<<"\n\nEnter the First Complex
Number";
c1.read();
cout<<"\n\nEnter the Second Complex
Number";
c2.read();
c3=c1+c2; // binary + overloaded
cout<<"\n\nSUM = ";
c3.display();
return 0;
}
# include <iostream>
using namespace std;
class student //base class Enter roll no and name .. 12101
{ KUMAR
private :
char name[20]; Enter lang,eng,phy,che,csc,mat
int rno; marks.. 99 97 52 65 89 95 90
36. எ கா : public:
ஒ வழி மர ம void acceptname() Roll no :-12101
( Single inheritance ) { Name :-KUMAR
cout<<"\n Enter roll no and name .. ";
cin>>rno>>name; Marks Obtained
} Language.. 99
void displayname() English .. 97
{ Physics .. 52
cout<<"\n Roll no :-"<<rno; Chemistry.. 65
cout<<"\n Name :-"<<name<<endl; Comp.sci.. 89
} Maths .. 95
#include<iostream>
40. ப வ எ
using namespace std; 21 22 23 24 25 26 27 28
ெதாடைர int main() 29 30
அ சி வத கான {
int i;
நிர கைள எ க
for(i=21;i<=30;i++)
(for loop) cout <<i<<" " ;
21 22 23 24 25……30 return 0;
sep -2021
}