XIISamplePracticalFile New2025
XIISamplePracticalFile New2025
CLASS: ___________________________________
GROUP: ___________________________________
EMAIL: ___________________________________
CONTACT: ___________________________________
COLLEGE: ___________________________________
SESSION: ___________________________________
Certificate
all the requirement of this practical file for the session 2024-25.
__________________________ ___________________________________
Start
Let factorial=1
Let counter=num
No
IF
makYear%4= 0
Yes
Stop
Practcial No.1 (Algorithm- Leap Year)
Step1: BEGIN
Step2: DECLARE makYear AS integer
Step2: WRITE “Enter any year to check whether it’s LEAP year or
NOT? "
Step3: READ, makYear
Step4: IF (makYear%4)=1 THEN
WRITE “Given year “,makYear,” is LEAP year”
ELSE
WRITE “Given year”, makYear,” ISN’T leap year”
Step5: READ a character
Step6: END
Practcial No.1 (Coding/Programming)
/* ************************************************************************
Object: Write a program that input a year and then check whether its leap year or Not
*************************************************************************/
#include <stdio.h>
#include <conio.h>
clrscr();
// below code is for showing heading of the output
printf("\n\t\t ");
printf("\n\t\tThis is sample Practical No.01");
printf("\n\t\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
printf("\n\t Enter any year to check whether it's LEAP year or NOT? "); scanf("%d",&makYear);
if(givenYear%4==0)
{printf("\n\t Given year %d is LEAP year",makYear);}
else
{printf("\n\t Given year %d ISN'T leap year",makYear);} getch();
Yes
Yes
NO
Test
INPUT marks(counter) IF percentage<33
Yes
PRINT “FAIL”
Let percentage=total*100.0/500
A Stop
Practcial No.2 (Algorithm- Marks sheet)
Step1: BEGIN
Step2: DECLARE total,counter AS integer, percentage as real
Step3:DIM marks(5) as integer
Step5: Set total=0, percentage=1.0
Step6: FOR counter=0 to 4 STEP 1
Step7: WRITE “Enter Subject [“, (counter+1),”] marks? “
Step8: READ marks[counter]
Step9: SET total= total + marks[counter]
Step10: NEXT counter
Step11: SET percentage = total * 100.0/500
Step12: FOR counter=0 to 4 STEP 1
Step13: WRITE “Subject [“, (counter+1),” = “, marks[counter]
Step14: NEXT counter
Step15: WRITE “Total= “, total, “out of 500”
Step16: WRITE “Percentage= “, percentage
Step17: IF percentage<33 THEN WRITE “FAIL” ELSE WRITE “PASS”
Step18: READ character
Step19: END
Practcial No.2 (Coding/Programming)
/* ******|PRACTICAL02:Write a program that read marks of 5 subjects, calculate the total
marks, percentage & state whether candidate is Pass or Fail.*****/
#include <stdio.h>
#include <conio.h>
int marks[5],total,counter;
float percentage;
// varible declaration.
clrscr();
// below code is for showing heading of the output
printf("\n\t\t ");
printf("\n\t\tThis is sample Practical No.02");
printf("\n\t\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
total=0;percentage=1.0;
for(counter=0;counter<5;counter++)
{
printf("\n\t Enter Subject [%d] marks? ",counter+1);
scanf("%d",&marks[counter]);
total+=marks[counter];
}
percentage=total*100.0/500;
for(counter=0;counter<5;counter++)
{
printf("\n\t Subject[%d] marks= %d",counter+1,marks[counter]);
}
printf("\n\n\t\tTotal= %d out of 500",total);
printf("\n\n\t\tPercentage= %.2f\n\n\t\t\t",percenta
ge);
if(percentage<33)
{printf("FAIL");} else
{printf("PASS");}
getch(); // pause screen till any button is pressed.
Subject[1] marks= 70
Subject[2] marks= 60
Subject[3] marks= 80
Subject[4] marks= 90
Subject[5] marks= 100
PASS
**************************************************************************/
Practcial No.3 (Flow Chart- Table of Inputted No.)
Start
INPUT makNumber
Let makMultiple=1
No
Test For
makMultiple < 12
Yes
PRINT
makNumber,”*”,makMultiple,”=”,
(makNumber*makMultiple)
Let makMultiple =
makMultiple+1
Stop
Practcial No.3 (Algorithm- Table of Inputted No.)
Step1: BEGIN
Step2: DECLARE makNumber,makMultiple as integer
Step3: WRITE “Enter any number to generate it’s table? "
Step4: READ makNumber
Step5: FOR makMultiple=1 TO 12 STEP 1
Step6: WRITE
makNumber,” *”,makMultiple,”=”,(makNumber*makMultiple)
Step7: NEXT makMultiple
Step8: READ character
Step9: END
Practcial No.3 (Coding/Programming)
/* ******|PRACTICAL03: Write program to generate the table of any inputted number
*****/
#include <stdio.h>
#include <conio.h>
Let factorial=1
Let counter=num
No
Test
For counter>= 1
Yes
Stop
Practcial No.4 (Algorithm- Factorial of inputted No.)
Step1: BEGIN
Step2: DECLARE counter,factorial,num AS long integer
Step2: WRITE “Enter Number for Factorial? "
Step3: READ num
Step4: SET factorial=1 Step5:
SET counter=factorial
Step7: FOR counter=factorial down to 2 STEP=-1
Step8: SET factorial=factorial*counter
Step9: NEXT counter
Step10: WRITE “Factorial of”, num, “= “, factorial
Step11: END
Practcial No.4 (Coding/Programming)/*
******|PRACTICAL04: Write a program that finds the factorial of an inputted
number.*****/
#include <stdio.h>
#include <conio.h>
int inputtedNumber,factorial;
// variable declaration.
Yes
INPUT “Enter Number2? “ PRINT mgNum2 ”is GREATEST
,mgNum2 among all three inputted”
No Test Stop
IF mgNum1 >
mgNum2
Yes
Test No
IF mgNum1 >
mgNum3
Yes
PRINT mgNum1 ”is GREATEST
among all three inputted”
A
Practcial No.5 (Algorithm- Greatest among 3 no.)
Step1: BEGIN
Step2: DECLARE mgNum1, mgNum2, mgNum3 AS integer
Step3: WRITE “Enter Number1”
Step4: READ mgNum1
Step5: WRITE “Enter Number2”
Step6: READ mgNum2
Step7: WRITE “Enter Number3”
Step8: READ mgNum3
Step9: IF mgNum1> mgNum2 THEN GOTO Step10 ELSE Step14
Step10: IF mgNum1> mgNum3 THEN Step8 ELSE Step9
Step11: WRITE “number1=”, mgNum1,” is GREATEST among all
three inputted Numbers”
Step12: WRITE “number3=”, mgNum3,” is GREATEST among all
three inputted Numbers”
Step13: ENDIF rem *** eof step7 if-structure ***
Step14: IF mgNum2>mgNum3 THEN GOTO Step15 ELSE Step16
Step15: WRITE “number2=”, mgNum2,” is GREATEST among all
three inputted Numbers”
Step16: ENDIF rem *** eof step15 if-structure ***
Step17: ENDIF rem *** eof step9 if-structure ***
Step18: WRITE “number3=”, mgNum3,” is GREATEST among all
three inputted Numbers”
Step19: END
Practcial No.5 (Coding/Programming)
/* ******|PRACTICAL05: Write a program that finds out the greatest number among three
inputted numbers. *****/
#include <stdio.h>
#include <conio.h>
int mgNum1,mgNumb2,mgNum3; // variable declaration.
void main(void) // main function.
{ // start of-(sof) body of main
function. clrscr();
// below code is for showing heading of the
output printf("\n\t\t ");
printf("\n\t\tThis is sample Practical No.05");
printf("\n\t\t~~~~~~~~~~~~~~~~~~~~~~~~~~~");
printf("\n\t Enter Number1 ? ");
scanf("%d",&mgNum1);
printf("\n\t Enter Number2 ? ");
scanf("%d",&mgNum2);
printf("\n\t Enter Number3 ? ");
scanf("%d",&mgNumb3);
if(mgNum1>mgNum2)
{ // body of outer-most if
statement. if(mgNum1>mgNumb3)
{ // body of inner if statement.
printf("\n\t\t number1=[%d] is GREATEST among all three inputted Numbers",mgNum1);
}
else
{ // else of inner if.
printf("\n\t\t number3=[%d] is GREATEST among all three inputted Numbers",mgNum3);
}
}
else if(mgNum2>=mgNum3)
{ // else-if of outer-most if statement.
printf("\n\t\t number2=[%d] is GREATEST among all three inputted Numbers",mgNum2);
}
else
{ // else of outer-most if statement.
printf("\n\t\t number3=[%d] is GREATEST among all three inputted Numbers",mgNum3);
}
getch(); // pause screen till any button is pressed.
} // end of-(eof) body of main function.
/************************ OUTPUT *************************************
Start
Let areaOfTriangle =
(1.0/2.0)*base*height
#include <stdio.h>
#include <conio.h>
#include <math.h>
#define pi 3.14
float areaOfTriangle,volumeOfSphere; // variable declaration.
int radius,base,height;
void main(void) // main function.
{ // start of-(sof) body of main
function. clrscr();
// below code is for showing heading of the
output printf("\n\t\t ");
printf("\n\t\tThis is sample Practical No.06");
printf("\n\t\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
printf("\n\t Enter Base of a triangle? ");
scanf("%d",&base);
printf("\n\t Enter Height of a triangle? ");
scanf("%d",&height);
areaOfTriangle=(1.0/2.0*base*height);
printf("\n\t Enter radius of an sphere? ");
scanf("%d",&radius);
volumeOfSphere= 4.0/3*pi*pow(radius,3);
printf("\n\t Area of Triangle[base=%d height=%d] is %.2f",base,height,areaOfTriangle);
printf("\n\t Volume of Sphere[radius=%d] is %.2f",radius,volumeOfSphere);
getch(); // pause screen till any button is pressed.
***********************************************************************/
Practcial No.7 (Flow Chart- Shatranjh Board)
Start A
Let mgRow=1
Let mgCol = mgCol + 1
4
5
2
Yes 1
Let mgCol=1
Stop
No Test
2 For mgCol <= 8
Yes
No Test
IF (mgRow+mgCol)
mod 2 = 0
Yes
PRINT “ “
3
PRINT “██”
3
A
Practcial No.7 (Algorithm-- Shatranjh Board)
Step1: BEGIN
Step2: DECLARE mgRow,mgColumn AS integer
Step3: FOR mgRow=1 to 8 Step=1
Step4: WRITELINE
Step5: FOR mgColumn=1 to 8 Step=1
Step6: IF (mgRow+mgColumn) Mod 2= 0 THEN WRITE “ “ ELSE
WRITE ” ██”
Step7: NEXT mgColumn
Step8: NEXT mgRow
Step9: READ character
Step10: END
Practcial No.7 (Coding/Programming)
/* ******|PRACTICAL07: Write a program to draw a check-board using if-else statement and
Nested for loops. *****/
#include <stdio.h>
#include <conio.h>
int mgRow,mgColumn; // variable declaration.
if((mgRow+mgColumn)%2==0)
printf(" ");
else
printf("██"); // Ascii code of █ is 219 can also be used.
} // end of for columnCounter loop.
Start
Let mgAsciiCode=32
No Test For
Stop mgAsciiCode <=
127
Yes
PRINT “Character is
“,char(mgAsciiCode),” (code= “,
mgAsciiCode , ”)”
Step1: BEGIN
Step2: DECLARE mgAsciiCode AS integer
Step3: FOR mgAsciiCode=32 to 127 Step=1
Step4: WRITE “Character is “,char(mgAsciiCode),” (code= “,
mgAsciiCode , ”)”
Step5: READ character
Step6: END
Practcial No.8 (Coding/Programming)
/* ******|PRACTICAL08: Write a program that generate characters corresponding to ASCII
codes from 32 to 127 (using any loop). *****/
#include <stdio.h>
#include <conio.h>
***********************************************************************/
Practcial No.9 (Flow Chart- Printing name 10 times)
Start
Let numOfTimes=1
Let numOfTimes =
Stop
numOfTimes+1
Practcial No.9 (Algorithm- Print name 10 times)
Step1: BEGIN
Step2: DECLARE Dim makName(20) AS character, numOfTimes
as integer
Step3: WRITE “Enter your name? “
Step4: READ makName
Step5: FOR numOfTimes=1 to 10 Step=1
Step6: WRITE “Your Name”, makName, “is printed “,
numOfTimes, “times
Step7: READ character
Step8: END
Practcial No.9 (Coding/Programming)
/* ******|PRACTICAL09: Write a program that reads your name and prints that name 10
times using scanf() and printf() statements) *****/
#include <stdio.h>
#include <conio.h>
Let divisor=makNum/2
Stop
Test
1 For divisor >= 2
Let flag=1
Test
IF flag = 0
A
Practcial No.10 (Algorithm- Prime No. checking)
Step1: BEGIN
Step2: DECLARE makNum,flag, divisor as integer
Step3: WRITE" Enter Number to check whether is PRIME OR NOT?
"
Step4: READ makNum
Step5: flag=0
Step6: FOR divisor=makNum/2 to 2 STEP= -1
Step7: IF (makNum MOD divisor)= 0 THEN
Step8: SET flag=1
Step9: WRITE divisor,” absolutely divide”, makNum
Step10: GOTO Step 13
Step11: END IF
Step12: NEXT divisor
Step13: IF flag=0 THEN WRITE “ Given Number “,makNum , “ is PRIME
Number " ELSE WRITE ",Hence given Number”,
makNum , “ is NOT a prime number"
Step14: ENDIF
Step15: END
Practcial No.10 (Coding/Programming)
/* ******|PRACTICAL10: Write a program that input a number and then check it whether it is
prime or not. *****/
#include <stdio.h>
#include <conio.h>
for(divisor=number/2;divisor>=2;divisor--)
{
if(number%divisor==0) {flag=1;printf("%d absolutely divide %d",divisor,number); break;}
}
***********************************************************************/
Practcial No.11 (Flow Chart)
Start
Step1: BEGIN
Step2: DECLARE mgName AS String, makAlphabet AS Character,
age AS integer, height AS Real number
Step3: WRITE “Enter your name? "
Step4: READ mgName
Step5: WRITE “Enter your favorite English alphabet?”
Step6: READ makAlphabet
Step7: WRITE “Enter your age (5-100 etc)? "
Step8: READ age
Step9: WRITE” Enter your height (5.4/6.0 etc)? " Step10:
READ height
Step11: WRITE “Your Name is”, mgName
Step12: WRITE “you like English alphabet “, makAlphabet
Step13: WRITE” you are “, age, “years old”
Step14: WRITE “and “, height, “feet tall."
Step15: END
Practcial No.11 (Coding/Programming)
/* ******|PRACTICAL11: Write a program which print a text of four lines consisting of
characters, integers value and floating point value using printf() statement and escape
sequences. . *****/
#include <stdio.h>
#include <conio.h>
Let makRow=1
3
4 Stop
No Test
2 For makCol <= 8
Yes
No Test caYsees
(makRow+makCol)
mod 2 = 0
Yes
PRINT “ “
3
PRINT “██”
3
A
Practcial No.12 (Algorithm- Switch Statement)
Step1: BEGIN
Step2: DECLARE makRow,makCol,result AS integer
Step3: FOR makRow=1 TO 8 STEP=+1
Step4: WRITELINE
Step5: FOR makCol=1 TO 8 STEP=+1
Step6: SET result=(makRow+makCol) MOD 2
Step7: IF result= 0 THEN WRITE “ “ELSE WRITE” ██”
Step8: END IF
Step9: NEXT makCol
Step10:NEXT makRow
Step11:READ character
Step12: END
Practcial No.12 (Coding/Programming)
/* ******|PRACTICAL12: Write a program, which uses Switch and break statement
.*****/
#include <stdio.h>
#include <conio.h>
int makRow,makCol,result; // variable declaration.
switch(result)
{ // start of switch(result) body.
case 0:printf(" ");break;
default:printf("%c%c",219,219); // Ascii code of █ is 219 can also be used.
} // end of switch(result)-statement.
***********************************************************************/
Practcial No.13 (Flow Chart- Pattern Printing)
Start
Let makRow=1
Test No
For makRow <=5 Stop
Yes
Let makCol=1
No Test
For makCol <= 2
makRow
Yes
PRINT “*“ Let makCol = makCol + 1
Step1: BEGIN
Step2: DECLARE makRow,makCol,result AS integer
Step3: FOR makRow=1 TO 5 STEP=+1
Step4: WRITELINE
Step5: FOR makCol=1 TO makRow STEP=+1
Step6: WRITE “ * “
Step7: NEXT makCol
Step8: NEXT makRow
Step9: READ character
Step10: END
Practcial No.13 (Coding/Programming)
/* ******|PRACTICAL13: Write a program using nested for loop to print the following output
*
**
***
****
*****
**********************************************/
#include <stdio.h>
#include <conio.h>
int makRow,makCol;
; // variable declaration.
for(makRow=1;makCol<=5;makRow++)
{
printf("\n\t\t\t"); // printing line and tab gap on screen.
for(makCol=1;makCol<=makRow;makCol++)
{
printf(" *");
} // end of for makCol loop.
} // end of for makRow loop.
getch(); // pause screen till any button is pressed.
} // end of-(eof) body of main function.
Start
makSum1(number1,number2)
Calling Sub-process
makSum1(number1 ,
number2)
Stop Start
Stop
Practcial No.14 (Algorithm- 2 Nos. SumFunction)
Step1: BEGIN
Step2: DECLARE makSum1(integer,integer) AS integer
Step3: DECLARE number1, number2 AS integer
Step4: WRITE “Enter Number1?”
Step5: READ number1
Step6: WRITE “Enter Number2?”
Step7: READ number2
Step8: Call makSum1(number1,number2)
Step9: READ character
Step10: END
#include <stdio.h>
#include <conio.h>
sum1(number1,number2); // calling sum1 function & passing number1 & number2 to it.
Enter Number2 ? 6
Sum of 7 + 6 = 13
***********************************************************************/
Practcial No.15 (Flow Chart- Payroll of Emplyee)
Flow chart of Sub-process
Start
Real percentageCalculator (amount
as Real, percentage as Integer)
Let medicalAllowance =
RETURN percentageCalculator(mgB
(amount*percent/100.0) AS asicPay, 25)
Real number
Let conveyanceAllowance=
percentageCalculator(mgB
asicPay, 20)
Stop
Let houseRent =
percentageCalculator(mgB
asicPay, 45)
Let gpFund =
percentageCalculator(mgB
asicPay, 7)
AAA
AAA
Stop
Practcial No.15 (Algorithm- Payroll of Employee)
Step1: BEGIN
Step2: DECLARE percentageCalculator(Realnumber, integer) AS
Real Number
Step3: DECLARE mgBasicPay, medicalAllowance,
conveyanceAllowance, houseRent, gpFund, grossPay, netPay AS
Real Number
Step4: WRITE “Enter Basic Pay? “
Step5: READ mgBasicPay
Step6: SET medicalAllowance=CALL
percentageCalculator(mgBasicPay,25)
Step7: SET conveyanceAllowance = CALL
percentageCalculator(mgBasicPay,20)
Step8: SET houseRent = CALL percentageCalculator(mgBasicPay,45)
Step9: SET gpFund = CALL percentageCalculator(mgBasicPay,7)
Step10: SET grossPay= mgBasicPay + medicalAllowance +
conveyanceAllowance + houseRent
Step11: SET netPay= grossPay-gpFund
Step12: WRITE “BASIC PAY= “, mgBasicPay
Step13: WRITE “MEDICAL ALLOWANCE= “, medicalAllowance
Step14: WRITE “Conveyance Allowance= “, conveyanceAllowance
Step15: WRITE “House Rent= “, houseRent
Step16: WRITE “Gross Pay= “, grossPay
Step17: WRITE “Deduction of GPFund= “, gpFund
Step18: WRITE “Net Pay= “, netPay
Step19: READ character
Step20: END
Step21: BEGIN FUNCTION percentageCalculator(amount AS Real
Number,percent AS integer)
Step22: RETURN (amount*percent/100.0)
Step23: END FUNCTION percentageCalculator
Practcial No.15 (Coding/Programming)
/* ******|PRACTICAL15: Write a program to calculate a pay roll of employees. Read the
Basic pay from key board. Calculate medical allowance as 25% of basic pay, conveyance
allowance as 20% and house rent 45 % of basic pay and deduction of GP fund 7% of basic
pay
#include <stdio.h>
#include <conio.h>
float mgBasicPay,medicalAllowance,conveyanceAllowance,houseRent,gpFund,grossPay,netPay;
// variable declaration.
medicalAllowance=percentageCalculator(mgBasicPay,25);
conveyanceAllowance=percentageCalculator(mgBasicPay,20);
houseRent=percentageCalculator(mgBasicPay,45);
gpFund=percentageCalculator(mgBasicPay,7);
grossPay=mgBasicPay+medicalAllowance+conveyanceAllowance+houseRent;
netPay=grossPay-gpFund;