[go: up one dir, main page]

0% found this document useful (0 votes)
8 views65 pages

Software APPLICATION

The document provides information about various software applications and programming languages. It discusses the Disk Operating System (DOS) commands, HTML tags and elements, CSS, JavaScript, and C++ across multiple pages.

Uploaded by

chettriramesh678
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views65 pages

Software APPLICATION

The document provides information about various software applications and programming languages. It discusses the Disk Operating System (DOS) commands, HTML tags and elements, CSS, JavaScript, and C++ across multiple pages.

Uploaded by

chettriramesh678
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 65

SOFTWARE APPLICATION

1. DOS (DISK OPERATING SYSTEM) page 1-4

2. HTML (HYPER TEXT MARKUP LANGUAGE) page 5-18

3. CSS page 19

4. JAVASCRIPT page 20-38

5. C++ page 39-64


DOS
(DISK OPERATING SYSTEM)
COMMANDS. .

1. >cd..- for backspace, use when we want to exit from folder.

For e.g—

> cd desktop .

2. > cls – for clear screen.

For e.g—

>cls

3. >dir – use if we have to see the list of folder and files.

For e.g—

> dir

4. >date – date

For e.g—

>date.

5. >time – time.

For e.g—

>time

1
6. >md – to create/make a directory/folder

For e.g—

>md folder name.

7. >ren- to change /rename the save directory

For e.g—

>ren first folder name new folder name

8. >rd – to remove the folder

For e.g—

>rd folder name

9. >exit – to exit the cmd/dos

For e.g—

>exit

10. >attrib +h – to hide file /folder

For e.g—

>attrib + h folder/file name

11. >attrib –h – to unhide file/folder

For e.g—

>attrib –h folder/file name

2
12. >start winword /excel/msaccess/powerpnt– to open the msword/excel/msaccess/powerpnt

For e.g—

>start wind word

>start excel

>start msaccess

>start powerpnt

13. >shutdown/s- shutdown

For e.g—

>shutdown/s

14. >shutdown/r –restart

For e.g—

>shutdown/r

15. >help color

For e.g.—

>color a2

3
TREE
1.SINGLE TREE

>cd desktop

>md folder name (shriya)

>cd shriya

>md apple

>cd..

>tree shriya

2. DOUBLE TREE

>cd desktop

>md tiger

>cd tiger

>md dog

>md cat

>cd cat

>md dog

>cd..

>cd..

>tree tiger

4
HTML
(HYPER TEXT MARKUP LANGUAGE)

HTML IS USED TO DESIGN WEB PAGE

FIRSTLY THERE ARE OPENING AND CLOSING TAGS

OPEANING TAGS CLOSING TAGS


<HTML> <\HTML>
<HEAD> <\HEAD>
<TITLE> <\TITLE>
<BODY> <\BODY>

For e.g—

<HTML>

<HEAD>

<TITLE>SHRIYA FIRST WEB PAGE </TITLE>

<\HEAD>

<BODY>

WEBEL

<\BODY>

<\HTML>

5
1. HEADING TAGS

<H1> <\H1>
<H2> <\H2>
<H3> <\H3>
<H4> <\H4>
<H5> <\H5>
<H6> <\H6>

For e.g—

<BODY>

<H1>BLACK<\H1>

<H2> PINK<\H2>

<H3>GREEN <\H3>

<H4> BLUE <\H4>

<H5> RED<\H5>

<H6>YELLOW <\H6>

<\BODY>

2. BREAKING TAG

THIS ELEMENT HAS NO CLOSING TAG AS OTHERS

For e.g—

<BODY>

MY NAME IS SHRIYA <BR>THIS IS THE EXAMPLE <BR> SHOW HOW CAN WE USE THE BREAK
LINE

<\BODY>

6
TAGS

1. <B> <\B> BOLD TAG

2. <I> <\I> ITALIC TAG

3. <U> <\U> UNDERLINE

4. <TT> <\TT> TELE TYPE IN MONO SPACE TYPE

5. <STRIKE> <\STRIKE> STRIKE THROUGH TEXT

6. <BIG> <\BIG> BOLD TEXT

7. <STRONG> <\STRONG> BOLD TEXT

8. <SUP> <\SUP> SUPERSCEIPT

9. <SUB> <\SUB> SUBSCRIPT

10. <DFN> <\DFN> USED FOR DEFINITION

11. <CODE> <\CODE> USED FOR EXTRACTS OF PROGRAM CODE

12. <DIV> <\DIV> DIVISION

13. <P> <\P> PARAGRAPH TAG

14. <DEL> <\DEL> DELETED TAG

15. <SAMP> <\SAMP> USED FOR SAMPLE OUTPUT OF A PROGRAM

16. <ACRONYM> <\ACRONYM>

17. <KBD> <\KBD>

18. <PRE> <\PRE>

19. <ABBR> <\ABBR> ABBREVIATION

3. HORIZONTAL LINE

THIS ELEMENT HAS NO CLOSING Tag

<hr> shriya <hr color=”pink”>

7
4. ALIGNMENT

For e.g—

<P ALIGN=”CENTER ,RIGHT,LEFT>WEBEL <\P>

5. BIO DIRECTIONAL OVERRIDE

For e.g—

<BDO DIR=”RTL”>SHRIYA <\BDO>

6. ORDER LIST

For e.g—

<OL>

<LI>CPU<\LI>

<LI>MONITER<\LI>

<LI>KEYBOARD<\LI>

<\OL>

7. UNORDER LIST

<UL>

<LI>MOUSE<\LI>

<LI>UPS<\LI>

<LI>QUEEN<\LI>

<\UL>

8
8. OPTION TAG

For e.g—

<Select>

<Option>Samsung<\option>

<Option>oppo<\option>

<Option>vivo<\option>

<Option>apple<\option>

<\select>

9. TYPE OF ATTRIBUTE VALUES

 CHECKBOX
 HIDDEN
 IMAGE
 RADIO
 RESET

10. INPUT TAGS

 COLOR = <INPUT TYPE =”COLOR” NAME=”MYCOLOR”>


 DATE = <INPUT TYPE =”DATE” NAME=”DOB”>
 DATETIME = <INPUT TYPE=”DATETIME” NAME=”DOB”>
 MONTH =<INPUT TYPE=”MONTH” NAME=”DOB”>
 NUMBER=<INPUT TYPE=”NUMBER” NAME=”PHONE NO”>

9
11. Marquee

Marquee element has 4 direction:

A) Left, b) right, c) down, d) up.

Marquee behavior, scrollamount and scrolledlay properties.

For e.g.

 <marquee> marquee <\marquee>

 <marquee direction=”up”> moving word to the up <\marquee>

 <marquee direction=”down”> moving word to the down <\marquee>

 <marquee direction=”right”> moving word to the right <\marquee>

 <marquee direction=”down”> moving word to the down <\marquee>

 <marquee behavior=”alternate”> this word will bounce back<\marquee>

 <marquee scrollamount=”60 %”> to speed up the quote <\marquee>

 <marquee scrollelay=”40 %”> to speed off the quote <\marquee>

10
12. TABLE TAG

<TH> </TH> TABLE HEADING


<TR> <\TR> TABLE ROWS

<TD> <\TD> TABLE DATA

For e.g

<body>

<table border=”2” cellspacing=”2”>

<th> AGE <\th>

<Tr>

<td>NAME<\td>

<td>DOB<\td>

<td>AGE<\td>

<td>REMARK<\td>

<\TR>

<TR>

<td>SHRIYA<\td>

<td>02-12-2000<\td>

<td>21<\td>

<td>Y<\td>

</TR>

</TABLE>

<\BODY>
11
13. FORM

A)

<body>

<FORM>

FIRST NAME : <input type=”text” name=”first_name”/>

LAST NAME: <input type=”text” name=”last_name”/>

D.O.B : <input type=”date” name=”dob”/>

ADDRESS : <input type=”text” name=”address”/>

PASSWORD : <input type=”number name=”password”/>

<button>SUBMIT </button>

</form>

</body>

B)

<body>

<form>

<label for =”user name”>username </label>

<input type=”text” name=”username”>

<label for =”email id”>email id </label>

<input type=”text” name=”email id”>

label for =”password”>password</label>

<button> login <\button>

<\form>

<\body>

12
14. TABLE & FORM TAG

a)

<body>

<table border=”2”>

<form>

<th> BIO DATA <\th>

<tr>

<td>NAME <\td>

<td> :<\td>

<td>SHRIYA <\td>

<\tr>

<tr>

<td>DOB <\td>

<td> :<\td>

<td> 02-12-2000<\td>

<\tr>

<tr>

<td>ADDRESS <\td>

<td> :<\td>

<td> DARJEELING<\td>

<\tr>

<\form>

<\table>

<\body>

13
b) APPLICATION FORM

<body>

<center> <h1> Application Form <\h1> <\center>

<form>

NAME :<input type=”text”>

ADDRESS :<textarea colos=”16” rows=”4”> <\textarea>

GENDER :<input type=”radio” name=”gender” value=”Male”> Male

<input type=”radio” name=”gender” value=”Female”> Female

<input type=”radio” name=”gender” value=”Others”> Others

Education Qualification: <input type=”checkbox”>10 pass

<input type=”checkbox”>12 pass

<input type=”checkbox”>Graduation pass

Religion <select>

<option>Hindu<\option>

<option>Sikh<\option>

<option>Muslim<\option>

<option>Christian<\option>

<option>Buddhist<\option>

<\select>

Clear <input type=”Reset” value=”Reset”>

Submit <input type=”Submit” value=”Submit”>

</form>

<\body>

14
15. STYLE

<title> cat </title>

<style>

h1{

font size=”xx large”

font style=”normal”

background color=”black”

color=”pink”

<\style>

<\head>

<body>

<h1> HYPER TEXT MARKUP LANGUAGE </h1>

<\body>

15
16. IMAGE TAG

<body>

<img src=”location of file\file name. file type” alt=”uloading” width”350” height=”450”>

</body>

17. AUDIO TAG

<body>

<audio controls autoplay>

<source src=”file location\file name. file type type=”audio/mpeg>

<\audio>

<\body>

18. VIDEO TAG

<body>

<video controls height=”250px”>

<source src=”file location\file name. file type type=”audio(video)/mpeg>

<\video>

<\body>

16
19. CALCULATOR

<body>
<h1>Calculator<\h1>

<div class =”formstyle”>

<form name=”form1”>

<input id =”calc type =”text” name=”answer> <br>

<input type=”button” value=”1” onclick=”form1.answer.value +=’1’ ”>

<input type=”button” value=”2” onclick=”form1.answer.value +=’2’ ”>

<input type=”button” value=”+” onclick=”form1.answer.value +=’+’ ”> <br>

<input type=”button” value=”3” onclick=”form1.answer.value +=’3’ ”>

<input type=”button” value=”4” onclick=”form1.answer.value +=’4’ ”>

<input type=”button” value=”-” onclick=”form1.answer.value +=’-’ ”> <br>

<input type=”button” value=”5” onclick=”form1.answer.value +=’5’ ”>

<input type=”button” value=”6” onclick=”form1.answer.value +=’6’ ”>

<input type=”button” value=”*” onclick=”form1.answer.value +=’*’ ”> <br>

<input type=”button” value=”7” onclick=”form1.answer.value +=’7’ ”>

<input type=”button” value=”8” onclick=”form1.answer.value +=’8’ ”>

<input type=”button” value=”/” onclick=”form1.answer.value +=’/’ ”> <br>

<input type=”button” value=”9” onclick=”form1.answer.value +=’9’ ”>

<input type=”button” value=”0” onclick=”form1.answer.value +=’0’ ”>

17
<input type=”button” value=”=” onclick=”form1.answer.value=eve (formal.
answer. value)”> <br>

<input type=”button” value=”clear all” onclick


=”form1.answer.value=’’”id”=”clear”>

<\form>

<\div>

<\body>

18
Css
File name.css

<title> css <\title>

<link rel=”stylesheet” herf=”name of file”>

<body>

<h1> shriya <\h1>

<\body>

19
JAVASCRIPT
1. A)

<\body>

<script>

a =20;

b = 20;

c = a+ b;

console.log(c)

document.write(c)

<\script>

B)

<\body>

<script>

var name =”shriya”;

var salary;

salary =50,000.25;

console.log(salary )

<\script>

20
2. BASIC OPERATORS

a) var cya =’shriya’;

var darjreeling = ‘sunam’;

console.log (cya + ‘ ‘ + darjreeling);

b) var I =1;

var j = ++;

var k = i++;

console.log(1-k);

c) var I = 1;

var j = --I;

var k= I --;

console.log(1-k)

21
3. Array

a) var myarray =[‘Hello’, ‘world’, ‘shriya’ ,Darjeeling’];

console.log(myarray[2];)

b) var myarray =[‘Hello’, ‘world’];

console.log(myarray. length);

c) var myarray =[‘Hello’, ‘world’];

myarray[1]=’shriya’;

i) var color=’red’;

document .write (color);

document.write(color);

document.write(“<br>”);

var color =”red”;

document.write(color);

ii) var a=”cya”;

document.write(type of (a));

22
iii) var a= 200;

if (a !=200){

document.write (“you have got 200rs”);}

else {

document.write(“you have got 100rs”);}

iv) var a=200;

if (a% 2==0){

document.write(“number is even”);}

else{

document.write(“number is odd”);}

v)for (i=1; i<=100;i++)

{document.write(“<p>” +i);}

for(i=30; i<=200; +i)

{document.write(“<p>”+i);}

for(i=0; 5>=4; i++)

{document.write(“<p>”+i);}

function greet – user (User name)

23
{message =”hello” +username; alert (message);}

function name(message)

{var message =”hello”;

Document.write (message);}

function greet (name)

{console.log(“hello” + “name”) ;}

Greet (“shriya”)

4. SHIFT OPERATOR

var a=8, b=2;

console.log (‘a<<b’:; + (a>>b);

console.log(‘a>>b:; +(a>>b);

24
5. RELATIONAL OPERATOR

Console.log (‘2==”2”:’+(2==2));

Console.log (‘2==”2”:’+(2===2));

Console.log (‘2!=”2”:’+(2!=2));

Console.log (‘2!==”2”:’+(2!==2));

Console.log (‘2>”2”:’+(2>2));

Console.log (‘2>=”2”:’+(2>=2));

Console.log (‘2<”2”:’+(2<2));

Console.log (‘2<=”2”:’+(2<=2));

6. BITWISE OPERATOR

var a=8, b=2;

console.log(‘a&b:’+(a&b)); 0 = false

console.log(‘a|b:’+(a|b)); 1 = true

console.log(‘a||b:’+(a||b));

console.log(‘a!b:’+(a!b));

25
7. SWITCHCASE OPERATOR

OR
STATEMENT OPERATOR

a) var day =”Sunday” ;

switch (day) {

case ‘mon’ : console.log (“today is monday”);

break;

case ‘tue’ : console.log (“today is tuesday”);

break;

case ‘wed’ : console.log (“today is wednesday”);

break;

case ‘thus’ : console.log (“today is thusday”);

break;

case ‘fri’ : console.log (“today is friday”);

break;

case ‘sat’ : console.log (“today is saturday”);

break;

case ‘sun’ : console.log (“today is sunday”);

break;

default: console.log(“day invalid”);}

26
b) var day =1;

switch (day) {

case 1: document.write(“today is monday”);

break;

case 1: document.write(“today is tuesday”);

break;

case 1: document.write(“today is wednesday”);

break;

case 1: document.write(“today is thuesday”);

break;

case 1: document.write(“today is friday”);

break;

case 1: document.write(“today is saturday”);

break;

case 1: document.write(“today is sunday”);

break;

default: document.write(“Entry the valid week day”);}

27
8. STRING PROCESSING

a) var s1 =”javascript”;
var s2 =”concat example”;
var s3 = s1. Concat (s2);
document.write (s3);

b) var s1 =”javascript to upper case example”;


var s2 = s1.toUpperCase();
document.write(s2);

c) var a =”javascript to blink”;


var b =a. blink ();
document.write(b);

28
9. HTML + JAVASCRIPT

i) BUTTON

a) <body>
<h1>Welcome to the javascript.com <\h1>
Entry a number:<input id=”num”> <br>
<button onclick=”fact()”> factorial <\button>
<p id=”res”> <\p>
<\body>
<script>
Function fact() {
Var I, num, f;
f = 1;
num document.getElementById(“res”).innerHTML=”the factorial of
a number”+i+”is”.+f;}
<\script>

29
b) <body>
<h5>How to link html and javascript ? <\h5>
<p>let’s do it <\p>
<p id =”example”> <\p>
<\body>
<script>
Document.getElementById(“example”)innerHTML=”web designing
is my favorite subject”;
<\script>
c) <h3>How function work in javascript ? <\h3>
<h5>let’s see the example <\h5>
<p id=”example”>she is writing a letter. <\p>
<button type=”button” onclick=”myFunction()”>
Click me! <\button>
<\body>
<script>
Function myFunction(){
Document.getElementById(“example”).innerHTML=”A letter is
being written by her”.}
<\script>

30
d) <body>
<p id =”example”> <\p>
<button type=”button” onclick=’myFunction()”>>Click me!
<\button>
<\body>
<script>
Function muFunction() {
Var a=50;
Var b=100;
Var c= a+b;
document.getElementByID(“example”).innerHTML=c;}
<\script>

31
e) <body>

Type your name:

<input type=”text” name Myname value=” ”>

<input type=button name =OK value=”Click herd to test”


onclick=Test(myName.value)>

<\body>

<script>

Function test (str) {

Alert (str.toUpperCase ())}

<\script>

f)

<body>

Type your name;

<input type=”text” name Myname value=”>

<input type=button name = OK value=”Click here to test”


onclick=Test(myName.value)>

<\body>

<script>

Function test(str){
alert (str.toUpperCAse() )

<\script>

32
11. FORM + JAVASCRIPT +CSS

<title> form <\title>

<link rel=”stylesheet” href=”file name”>

<body>

<h3>FORM <\h3>

<p id=”example”> <\p>

<form>

First name : <input type=”text” name=”first_name”/>

Last name: <input type=”text” name=”last_name”\>

Email id: <input type=”text” name=”email_id”\>

Password: <input type=”number” name=”password”\>

<button type =”button” onclick=”myFuntion()”>Submit <\button>

<\form>

<\body>

<script>

Function myFunction() {

Document.getElementById(“example”).innerHTML=”finished”}

<\script>

33
12. OPTION + JAVASCRIPT

<body>
<h3>Choose an item from drop-down list and click for select <\h3>
<from>

<select name=”combo box”>

<option value=”Apple”>Apple <\option>

<option value=”Microsoft”>Microsoft <\option>

<option value=”Sun microsystem”>Sun Microsystem<\option>

<\select>

<input type =submit value=”click for select” onclick=ClickEvent (combox-


box.value)>

<\form>

<\body>

<script>

Function ClickEvent (items) {

alert (“The selected item is + item)}

<\script>

34
13. DATA OBJECTIVE

<\head>
<script>
Function display Time( )
{
var myDate = newData ()
var currHour=myData.get.Hour ()
var currMinute=myData.get Minutes ()
var currseconds =myData.getSrconds ()
var curtime=” “
cur Time+=” “ +((currHour>12)?currHour-12: currHour)
cur Time+=” “ +((currMinute<10)?”:0”:”:”+)currMinute
cur Time+=” “ +((currSeconds<10)?”:0”:”:”+)currseconds
cur Time+=” “+((currHour>=12)?”PM”:”AM”)text1.value=currTime
myTime =setTimeout(“display Time()”,1000)
}
<\script>
<body onload= “display Time ()”>
<script>

35
Var myTime =null
Var TheDATA =new DATA()
My Page +=”<h1>Working with data <\h1>
My Page +=”<hr size =5 NOSHADDE>”
My page +=”<h3>the data is :”+(the Data. Get Month () +1)+”/” +
theDATA:getDay”GETDay()+”/”+theData.get Year<\h3>
Document.write (mypage)
<\script>
<input type =text name=”text1.>
<\body>

36
14. MATH OBJECT METHODS

<body>

<input type =button name= rand value=”Generete random


number”onclick=test ()>

<input type =button name =pow.value=”Genrate power


number”onclick=test1.()>

<input type =button name =sqrt .value=”Genrate


powernumber”onclick=test2.()>

<\body>

<script>

Function test() {

var x =0;

x=Math.floor(Math.pow()*100)

alert (Generate number is :”+x) }

function test() {

r=Math.floor(Math.pow(4,3))

alert (Generate number is:”+r) }

function test 2() {

var a=0

a=Math.flor(Math.sqrt(5))

alert(“Generate number is:”+a) }

37
15. SQUARE ROOT

<body>

<from name=form1>

Enter Number:

<input type=”text” name=”input1” size=10>

<input type=”button” value=”Calculate”onclick=’doMath()’> <br>

The Square root is:

<input type=”text” name=”answer”size=20>

<\from>

<\body>

<script>

Function doMath() {

Var input Num1=document.form1.input1.value;var result=Math.sqrt


(inputnum);

Document.form1.answer.value=result;}

<\script>

38
C++

Introduction of C++

C++ was developed by Bjarne Stroustrup as an extension of the c. It was first


appared in 1985. It is one of the world’s most popular programming
languages.

#include <iostream> (header line)

int main() (function line)

{ (body open) } (body close)

cout<<”” (output or which print the answer.)

39
1) BIO-DATA

#include <iostream>

Using namespace std;

Int main()

Cout<<” Name :Shriya”<<’\n’;

Cout<<”Father’s name :Ashok”<<’\n’;

Cout<<”Address: Darjeeling”<<’\n’;

Cout<<”Date Of Birth: 02-12-2000:”<<’\n’;

Cout<<”Contact Number: 9874563210”<<’\n’;

Cout<<”Qualifaction : M.A”<<’\n’;

return 0;

40
2) ADDITION

#include <iostream>

Using namespace std;

Int main()

Int a=2 5;

Int b=65;

Int c= a+b;

Cout<<”The addition of a and b:”<<c;

return 0;

3) SUBTRACTION

#include <iostream>

Using namespace std;

Int main()

Int a = 60;

Int b=38;

Int c= a-b;

Cout<<”The subtraction of a and b:”<<c;

return 0;

41
4) MULTIPLICATION

#include <iostream>

Using namespace std;

Int main()

Int a = 60;

Int b=8;

Int c= a*b;

Cout<<”The multiplication of a and b:”<<c;

return 0;

5) Divide

#include <iostream>

Using namespace std;

Int main()

Int a = 60;

Int b=3;

Int c= a/b;

Cout<<”The divide of a and b:”<<c;

return 0;

42
6) REMAINDER

#include <iostream>

Using namespace std;

Int main()

Int a = 60;

Int b=8;

Int c= a%b;

Cout<<”The remainder of a and b:”<<c;

return 0;

7) ADDITION – SUBTRACTION – MULTIOLICATION – DIVIDE- REMAINDER

#include <iostream>

Using namespace std;

Int main()

Int a = 60;

Int b=38;

Int c=a+b;

Int d= a-b;

43
Int e=a*b;

Int f=a/b;

Int g=a%b;

Cout<<”The addition of a and b:”<<c;

Cout<<”The subtraction of a and b:”<<d;

Cout<<”The multiplication of a and b:”<<e;

Cout<<”The divide of a and b:”<<f;

Cout<<”The remainder of a and b:”<<g;

return 0;

8) MAXIMUM

#include <iostream>

Using namespace std;

Int main()

Int a =10;

Int b=5;

Int c=a>b? a:b;

Cout<<”The max no in a and b:”<<c;

return 0;

44
9) MINIMUM

#include <iostream>

Using namespace std;

Int main()

Int a=35;

Int b=25;

Int c=a<b? a:b;

Cout<<”The min number in a and b:”<<c;

Return 0,

10) SIMPLE INTREST

#include <iostream>

Using namespace std;

Int main()

Int balance =3000;

Int rate =3;

Int time=2;

Int interest = balance*rate*time/100;

45
Int amount =balance+ interest;

Cout<<”The interest is:”<<interest;

Cout<<”The amount:”<<amount;

Return 0;

11) PROFIT

#include <iostream>

Using namespace std;

Int main()

Int cp=1200;

Int sp=2500;

Int profit=sp-cp;

Cout<<”Profit”<<profit<<endl;

Return 0;

46
12) LOSS

#include <iostream>

Using namespace std;

Int main()

Int cp =1000;

Int sp -800;

Int loss=sp-cp;

Cout<<”loss”<<loss<<endl;

Return 0;

13) AGE

#include <iostream>

Using namespace std;

Int main()

Char name[15];

Cout\,,”Enter your name:”;

Cin>>name;

Int age;

Cout<<”Enter your age:”;

47
Cin>>age;

If (age>18)

Cout<<”You can vote”<<name;

Else

Cout<<”You cannot vote”<<name;

Return 0;

14) LEAP YEAR

#include <iostream>

Using namespace std;

Int main()

Int a;

Int year;

Cout<<”Enter the year:”;

Cin>>year;

If (a % 4==0)

Cout<<”This is a leap year>”;

else

Cout<<”This is not a leap year”;

Return 0;

48
15) SWITCH STATEMENT

a.

#include <iostream>

Using namespace std;

Int main()

Int a;

Cout<<”Enter the number:”;

Cin>>a;

Switch (a)

Case 1:

Cout<<”Monday”;

Break;

Case 2:

Cout<<Tuesday”;

Break;

Case 3:

Cout<<”Wednesday”;

Break;

Case 4:

Cout<<”Thursday”;

49
Break;

Case 5:

Cout<<”Friday”;

Break;

Case 6:

Cout<<”Saturday”;

Break;

Case 7:

Cout<<”Sunday”;

Break;

Default :

Cout<<”invalid number”:;

Return 0;

b.

#include <iostream>

Using namespace std;

Int main()

50
Char alp;

Cout<<”Enter any alphabet:”;

Cin>>alp;

Switch (alp)

Case ‘a’:

Cout<<”it is a vowel” ;

Break ;

Case ‘e’:

Cout<<”it is a vowel” ;

Break ;

Case ‘i’:

Cout<<”it is a vowel” ;

Break ;

Case ‘o’:

Cout<<”it is a vowel” ;

Break ;

Case ‘u’:

Cout<<”it is a vowel” ;

Break ;

default :

cout<<”not a vowel”;

51
}

Return 0;

16) DO WHILE LOOP

#include <iostream>

Using namespace std;

Int main()

Int x=1, fact =1;

Int y ;

cout<<”Enter value of y =”;

cin>>y;

Do

Fact=fact*x;

X++;

While(x<=y);

cout<<”Fractonal value of =”<<y<<”=”<<fact;

Return 0;

52
17) EVEN NUMBER

#include <iostream>

Using namespace std;

Int main()

Int a;

For (a=2; a<=20;a++)

If (a%2==0)

Cout<<”The even number from 2 to 20 are”<<a<<endl;

Return 0;

18) ODD NUMBER

#include <iostream>

Using namespace std;

Int main()

Int a;

For(a=1;a<=20;a++)

If(a% 2!=0)

Cout<<”The odd number from 1 to 20 are”<<a<< endl ;

Return 0;

53
19) TABLE OF 7 USING FOR LOOP

#include <iostream>

Using namespace std;

Int main()

Int a=7;

For (int b=1;b<=20;b++)

Cout<<”The table of 7:”<<a<<”*”<<b<<a*b<<endl;

Return 0;

20) TABLE2 USING FOR LOOP (user defined)

#include <iostream>

Using namespace std;

Int main()

Int a;

Cout<<”Enter the number:”;

Cin>>a;

For (int b=1; b<=20;b++)

Cout<<”The table of your number “<<a<<”*”,,b<<”=”<<a*b<<endl ;

Return 0;

54
21) SQUARE POWER

#include <iostream>

Using namespace std;

Int main()

INT A;

COUT<<”Enter the number for square power value:”<<0;

Cin>>a;

Cout<<”The square power value of your number is :” endl;

Int b =a*a;

Cout<<b<< endl;

Return 0;

22) CUBE POWER

#include <iostream>

Using namespace std;

Int main()

Int a;

Cout<<”Enter the number for square power value:”;

Cin>>a;

55
Cout<<The cube power value of your number is:”<<endl;

Int b=a*a*a

Cout<<b<<endl;

Return 0;

23) INCREMENT

#include <iostream>

Using namespace std;

Int main()

Int a;

Cout<<”Enter the number for square value:”

Cin>>a;

a ++;

cout<<”The square value of your number is:”<<endl;

return 0;

56
24) DECREMENT

#include <iostream>

Using namespace std;

Int main()

Int a;

Cout<<”Enter the number for square value:”;

Cin>>a;

a--;

cout<<”The square value of your number is:”<<endl;

return 0;

25) SQUARE

#include <iostream>

Using namespace std;

Int main()

Int a;

Cout<<”Enter the number for square value:”;

Cin>>a;

57
Cout<<”The square value of your number is :”<<endl;

Cout<<sqrt (a) <<endl;

Return 0;

26) STRING LENGTH

(to count the length of the entered word)

#include <iostream>

Using namespace std;

Int main()

Char a [20];

Cout<<”Enter your word”;

Cin>>a;

Cout<<”The length of your word is:<<endl ;

Cout<<”strlen (a)” endl;

Return 0;

58
27) STRING REVERSE

(to reverse the entered word)

#include <iostream>

Using namespace std;

Int main()

Char a [20]

Cout<<”Enter your word:”;

Cin>>a;

Cout<<”The reverse value of your word is ;”<<endl;

Cout<<”strrev (a)”<<endl;

Return 0;

29) STRING LOWERCASE

(to change the case of the entered word to lower case)

#include <iostream>

Using namespace std;

Int main()

Char a [20];

59
Cout<<”Enter your word in capital:”;

Cin>>a;

Cout<<”The lowercase value of your word is:”<<endl;

Cout<<”strlwr (a)” <<endl;

Return 0;

30) STRING UPPERCASE

(to change the case of the entered word to upper case)

#include <iostream>

Using namespace std;

Int main()

Char a[20];

Cout<<”Enter your word in lower case:”;

Cin>>a;

Cout<<”The capital value of your word is :”<<endl;

Cout<<”strupr (a)”<<endl;

Return 0;

60
31) STRING CONCATENATED

(to attach the halves word)

#include <iostream>

Using namespace std;

Int main()

Char a [20];

Cout<<”Enter your word in half:”;

Cin>>a;

Char b[20];

Cout<<”enter your word in half:”;

Cin>>b;

Cout<<”strcat (shr,iya)<<endl;

Return 0;

31) ARRAY

a) SINGLE ARRAY

(number \ integet type )

#include <iostream>

Using namespace std;

Int main()

61
{

Int a [ ]={1,2,3,4};

Cout<<”value of array are:”<<endl;

For (int b=0,b ,=3; b++)

Cout<<a[b]<<endl;

Return 0;

b) MULTIPLE ARRAY
#include <iostream>

Using namespace std;

Int main()

Int a[2] [4] ={{ 1,2,3,4} {5,6,7,8}};

Cout<<”value of array are:”endl;

For (int b=0;c<4; c++)

Cout<<a[b] [c]<<endl;

Cout<<endl;

Return 0;

62
32) SINGLE ARRAY (haracter type)

#include <iostream>

Using namespace std;

Int main()

Int a[ ] ={ 1,2,3,4 };

Cot<<”value of array are:”<<endl ;

For (int b=0; b<=3; b++)

Cout<<a [b]<<endl;

Return 0;

33) MULTIPLE ARRAY

#include <iostream>

Using namespace std;

Int main()

Char a [2] [4] ={{ ‘A’,’N’,’A’,’B’},{‘I’,’G’,’Y’,’A’}};

Cout<<”value of array are:”<<endl;

For ( char b=0; b<2; b++)

63
{

For (char c=0; c<4; c++)

Cout<<a [b][c]<<endl;

Return 0;

64

You might also like