Skip to content

Commit bef59f7

Browse files
Add files via upload
1 parent 17c38fd commit bef59f7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1534
-0
lines changed

2020 1st programme.cpp

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#include<iostream>
2+
#include<string>
3+
using namespace std;
4+
class member
5+
{
6+
char name[100], address[1000];
7+
int age[2],phone[10];
8+
public
9+
cout<<"welcome to the company just give me few details so that we can calculate your salary";
10+
cout<<"please enter your name/n";
11+
cin>>name[100];
12+
cout<<"plz enter your address"<<endl;
13+
cin>>address;
14+
cout<<"plz enter your age"<<endl;
15+
cin>>age;
16+
cout<<"plz enter your phone no"<<endl;
17+
cin>>phone;
18+
void printsalary()
19+
{
20+
cout<<"the total salary is"<<printsalary;
21+
}
22+
};
23+
class employee public:member
24+
{
25+
char department[100],specialization[100];
26+
cout<<"plz enter your department name whether it is scse,sccy,smee,sece "<<endl;
27+
cin>>department;
28+
cout<<"plz enter your specialization"<<endl;
29+
cin>>specislization;
30+
};
31+
class manager public:member
32+
{
33+
char department[100],specialization[100];
34+
if(department==sals)
35+
{
36+
printsalary==20000;
37+
}
38+
else if(department==sccy)
39+
{
40+
41+
printsalary==15000;
42+
}
43+
else if(department==smee)
44+
{
45+
printsalary==10000;
46+
}
47+
else(department==sece)
48+
{
49+
printsalary==5000;
50+
}
51+
};
52+
void main()
53+
{
54+
member.obj;
55+
obj.employee;
56+
obj.member;
57+
obj.manager;
58+
}

5star.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include<iostream>
2+
using namespace std;
3+
int main()
4+
{
5+
6+
int i,j;
7+
for(i=0;i<5;i++)
8+
{
9+
10+
cout<<endl;
11+
for(j=0;j<i;j++)
12+
{
13+
14+
cout<<"*";
15+
}
16+
17+
}
18+
return 0;
19+
}

area of rectangle.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include<stdio.h>
2+
void main()
3+
{
4+
int a=2,b=3,c;
5+
c=a*b;
6+
printf("area of the rectangle is %d",c);
7+
}

area of right triangle.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#include<stdio.h>
2+
void main()
3+
{
4+
int b,h,a;
5+
printf("please enter the value of the base \n");
6+
scanf("%d",&b);
7+
printf("please enter the value of the height \n");
8+
scanf("%d",&h);
9+
a=0.5*b*h;
10+
printf("the value is\n%d",a);
11+
}

armstrong.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#include<stdio.h>
2+
void main()
3+
{
4+
int a,s=0,x,i;
5+
printf("plz enter the no to be tested");
6+
scanf("%d",&a);
7+
for(i=a;i>0;i=i/10)
8+
{
9+
x=i%10;
10+
s=s+x*x*x;
11+
}
12+
if(a==s)
13+
{
14+
printf("the value is palendrom");
15+
16+
}
17+
else
18+
{
19+
printf("the value is not the paliendrom");
20+
}
21+
}

bating.cpp

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#include<iostream>
2+
#include<string>
3+
using namespace std;
4+
class batsman
5+
{
6+
private:
7+
int bcode,innings,notout,runs,batavg;
8+
string bname;
9+
10+
public:
11+
void readdata()
12+
{
13+
cout<<"welcome to ICC and now give me some data you want to access from me";
14+
cout<<"plz enter the 4 digit batsman code";
15+
cin>>bcode;
16+
cout<<"plz enter the no of innings";
17+
cin>>innings;
18+
cout<<"plz enter the name of the batsman";
19+
cin>>bname;
20+
cout<<"now enter the no of notout";
21+
cin>>notout;
22+
cout<<"plz enter the no of run";
23+
cin>>runs;
24+
}
25+
void calcavg()
26+
{
27+
batavg=runs/=innings-notout;
28+
29+
}
30+
void displaydata()
31+
{
32+
cout<<" the no of innings is"<<innings;
33+
cout<<"4 digit batsman code is"<<bcode;
34+
cout<<"the name of the batsman"<<bname;
35+
cout<<"the no of run is"<<runs;
36+
cout<<"and the avg of the batsman is"<<batavg;
37+
}
38+
39+
};
40+
int main()
41+
{
42+
batsman obj;
43+
obj.readdata();
44+
obj.calcavg();
45+
obj.displaydata();
46+
47+
}

c++firstprogramme.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#include<iostream.h>
2+
void main()
3+
{
4+
}

circle.cpp

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#include<iostream>
2+
using namespace std;
3+
class circle
4+
{
5+
int radius;
6+
double area,circumference;
7+
public:
8+
circle()
9+
{
10+
radius=1;
11+
}
12+
setradius()
13+
{
14+
cout<<"please enter the radius of the circle"<<endl;
15+
cin>>radius;
16+
}
17+
calcdimentions()
18+
{
19+
circumference=2*3.14*radius;
20+
area=3.14*radius*radius;
21+
}
22+
display()
23+
{
24+
25+
cout<<"the circumference of the circle is"<<circumference<<endl;
26+
cout<<"the area of the circle is"<<area<<endl;
27+
}
28+
};
29+
int main()
30+
{
31+
circle c1,c2;
32+
c1.setradius();
33+
c1.calcdimentions();
34+
c1.display();
35+
c2.calcdimentions();
36+
c2.display();
37+
return 0;
38+
}

class illustration.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#include<iostream>
2+
using namespace std;
3+
class one
4+
{
5+
private:
6+
int a;
7+
public:
8+
one(){a=1;}
9+
friend class two;
10+
};
11+
class two
12+
{
13+
private: int b;
14+
public: void display(one&one)
15+
{cout<<"value of a"<<one.a;
16+
}
17+
};
18+
int main()
19+
{
20+
one one;
21+
two t;
22+
t.display(one);
23+
}

class room #define example.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#include<stdio.h>
2+
#define height 100
3+
#define no 3.14
4+
#define x 'a'
5+
#define string_var "are"
6+
#define special_symbol '\?'
7+
void main()
8+
{
9+
printf("the value of height is %d \n",height);
10+
printf("the value of no is %f \n",no);
11+
printf("the value of x is %c \n",x);
12+
printf("the value of string is %s \n",string_var);
13+
printf("the value of symbol is %c ",special_symbol);
14+
}

0 commit comments

Comments
 (0)