0% found this document useful (0 votes)
33 views27 pages

HTML 57 To Onword

The document outlines a series of demonstration plans for teaching various programming concepts in a COPA trade course at I.T.I. Each plan includes objectives, required materials, procedures, and summaries of the programming concepts being taught, such as HTML structure, data types, control statements, loops, and arrays. The emphasis is on hands-on practice and ensuring trainees can accurately write and understand the programs.

Uploaded by

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

HTML 57 To Onword

The document outlines a series of demonstration plans for teaching various programming concepts in a COPA trade course at I.T.I. Each plan includes objectives, required materials, procedures, and summaries of the programming concepts being taught, such as HTML structure, data types, control statements, loops, and arrays. The emphasis is on hands-on practice and ensuring trainees can accurately write and understand the programs.

Uploaded by

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

Demonstration Plan

Institute I.T.I.
Name of the Instructor DUMNE S S
Trade COPA
Objective
Skills 57
Proposed date
Date of Demonstration
Preparation
1) Material
2) Tools & Equipments Windows xp latest version pc
3) Other requirement
Review
Link .
Motivation Must be able to write the program using
Presentation Explanation of the <html><head> </head>
<title></title><body></body></html>

Procedure(doing) Information points & Spot Hint/ Question


Safety (Telling) (Asking/ Showing)
Procedure 1. key the following program in a Write a program to
new file. welcome to other trade
<html>i names.
<head>
welcome</head>
<body>
welcome to copa in yeola iti
</body>
</html>

Application: Relevant rules should be applied while doing the practical of functions

Summary: Explanation of the <html><head> </head> <title></title><body></body></html>


tags used in the html Programes.
Demonstration Plan

Institute I.T.I.
Name of the Instructor DUMNE S S
Trade COPA
Objective Define variables of various data types. Specify conversion
specifier to format i/o.
Skills 86
Proposed date
Date of Demonstration
Preparation
1) Material
2) Tools & Equipments Windows xp latest version pc
3) Other requirement
Review
Link .
Motivation Must be able to write the program using variables of various
data types. Specify conversion specifiar to format I/o.
Presentation Explanation of the variables of various data types. Specify
conversion specifier to format I/o on black board.

Procedure(doing) Information points & Spot Hint/ Question


Safety (Telling) (Asking/ Showing)
Procedure 1. Invoke tc- IDE Write a program to use all
Use of Operators. 2. key the following program in a operators.
new file.
/*Relation Operators:*/
main ( )
{
int a=10, b=20, c=30,d,e;
d=a>b
e=b<=c
printf (“%d%d”,d,e);
}
/*Increment and Decrement
operators:*/
main ()
{
int a=10; b=10;
printf (“a++=%d\n”,a++);
printf (“++b=%d\n”,++b);
printf (“-- a =%d\n”,-- a );
printf (“b-- = %d\n”,b--);
}
/*Co*/
main ()
{
int I;
scanf (“%d”,&I);
(I = =1? Printf (“ you pressed 1”) :
printf (“you pressed other than
1”);
}
4.compile the program to check
for errors & run the program to
get the output.
5.record the displayed output.
6. Run
Enter the number :
5
The factorial of given number is :
120
7. close the file.

Application: Relevant rules should be applied while doing the practical of Operators.
Summary Be able to write the program using variables of various data types. Specify
conversion specifier to format I/o.

Demonstration Plan

Institute I.T.I.
Name of the Instructor DUMNE S S
Trade COPA
Objective Make use of if-else statement for decision making and
selecting one alternative from given two alternatives.
Skills 87
Proposed date
Date of Demonstration
Preparation
1) Material
2) Tools & Equipments Windows xp latest version pc
3) Other requirement
Review
Link .
Motivation Must be able to write the program using of if/else statement
for decision making and selecting one alternative from
given two alternatives.
Presentation Explanation of the use of if/else statement for decision
making and selecting one alternative from given two
alternatives on black board.

Procedure(doing) Information points & Safety (Telling) Spot Hint/ Question


(Asking/ Showing)
If- if else statement 1. Invoke tc- IDE Write a program to
2. key the following program in a new if & if/else
file. statement.
main ( )
{
int num1,num2, big;
printf (“/n Enter two numbers:”);
scanf (“%d %d” , &num1, &num 2);
big = num1;
if (num1 < num2)
{
big = num2 ;
}
printf (“/n The biggest no is %d” , big) ;
}
}
4. Save the program as BIG.C Compile
and run the program.
3. close the file.

/*use of IF…..Else statement */


main ()
{
float bs , gs, da, hra ;
printf (“Enter basic salary :”);
scanf ( “%f “&bs);
if (bs<1500)
{
hra = bs * 10/100;
da = bs* 90/100;
{
else
}
hra = 500;
da = bs * 98/100;
}
gs = bs+ hra + da;
printf (“/n Gross salaty = Rs. %f” , gs); }
Application: Relevant rules should be applied while doing the practical of if/else
statement for decision making and selecting one alternative from given two alternatives.

Summary use of if/else statement for decision making and selecting one
alternative from given two alternatives.

Demonstration Plan

Institute I.T.I.
Name of the Instructor
Trade COPA
Objective Make use of do-while loop to perform steps predetermined
times & at certain increment.
Skills 88
Proposed date
Date of Demonstration
Preparation
1) Material
2) Tools & Equipments Windows xp latest version pc
3) Other requirement
Review
Link .
Motivation Must be able to write the program using do while loop.
Presentation Explanation of the do while loop on black board.

Procedure(doing) Information points & Safety (Telling) Spot Hint/ Question


(Asking/ Showing)
Procedure 1. Invoke tc- IDE Write a program to
Use of do while 2. key the following program in a generate the prime
loop new file. numbers using do while
main() loop.
{
char yes ;
int a, b;
do
}
printf (“/n Enter two values : “) ;
scanf (“SUM %d” , a+b);
printf (“/n Do you want to continue
(Y/N): “) ;
SCANF (“%C” , & yes );
}
while ( ( yes = = ‘Y’ )|| (yes = = ‘y’ ) );
}
4. close the file.

Application: Relevant rules should be applied while doing the practical of for loop.

Summary The do while loop is entry control loop & is probably the most popular
looping control statement. It is used to repeat set of instructions
repeatedly until the condition becomes false.

Demonstration Plan

Institute I.T.I.
Name of the Instructor
Trade COPA
Objective Make use of for- loop to perform steps predetermined
times & at certain increment.
Skills 89
Proposed date
Date of Demonstration
Preparation
1) Material
2) Tools & Equipments Windows xp latest version pc
3) Other requirement
Review
Link .
Motivation Must be able to write the program using do – while
loop.
Presentation Explanation of the do while loop on black board.

Procedure(doing) Information points & Safety Spot Hint/ Question


(Telling) (Asking/ Showing)
rocedure 3. Invoke tc- IDE Write a program to
Use of for loop 4. key the following program in generate the prime
a new file. numbers using for loop.
/*To calculate the factorial of a
number*/ main ( )
{
Int num, count, fact=1;
Printf (“Enter the number : /n”);
Scanf (“0%d”, & num);
For (count =1; count<=num;
count++)
{
Fact = fact*count ;
}
Printf (“Factorial of given
number is :%d”,fact);
}
3.Save the program as
factorial.c
4.compile the program to check
for errors & run the program to
get the output.
5.record the displayed output.
6. Run
Enter the number :
5
The factorial of given number is
: 120
7. close the file.

Application: Relevant rules should be applied while doing the practical of for loop.

Summary The for loop is another entry control loop & is probably the most
popular looping control statement. It is used to tocutset of instructions
repeatedly until the condition becomes false.

Participation of Participation of the trainees encouraged.


Demonstration Plan

Institute I.T.I.
Name of the Instructor
Trade COPA
Objective Use of break & continue statement to jump out of
loop or jump back to loop.
Skills 90. writing the program to use break & continue
statement.
Proposed date
Date of Demonstration
Preparation
1) Material Windows xp latest version pc
2) Tools & Equipments
3) Other requirement
Review Use of for loop
Link Application of the relevant rules.
Motivation Must be able to write the program using for loop .
Presentation Explanation of the break & continue statement on
the blackboard and confirm that all the trainees
have understood the same.

Procedure(doing) Information points & Spot Hint/ Question


Safety (Telling) (Asking/ Showing)
Chapter No. 1. Invoke TC- IDE Write a program to
2. Type the following calculate average of
program in a new file. positive no.s using break
/* Average of non negative & continue statement.
numbers*/
Main ( )
{
Int n, count, navg =0;
Float x, average, sum=0;
Printf (“Enter the range of
numbers :”);
scanf (“%d”,&n );
for (count =1;count<=n;
++count)
{
Printf (“x=”);
scanf (“%f”,&x );
if (x<0) continue ;
sum +=x;
++navg ;
}
Average =sum/navg ;
Printf (“/n The average is %f”,
average );
}
3. Save the program as
AVERAGE.C
4. Compile the program to
check for errors & run
the program.
Use of break statement main ( )
{
int i=0, x=0;
for (i=0; i<10 ; ++i)
{
if (i%2 = =1)
x+ =I;
else
x--;
printf (“%d”, x);
break ;
}
Printf ( “/nx = %d”, x);
}
5. Save the program as
BREAK.C
6. Compile the program to
check for errors & run
the program.

Application: Relevant rules should be applied while doing practical of break


& continue statement.

Summary Accuracy in writing a program using break & continue statement.

Participation of Participation of the trainees encouraged.


the trainees.

Demonstration Plan

Institute I.T.I.
Name of the Instructor
Trade COPA
Objective Writing the program using switch statement for
selecting one alternative from no. of alternatives.
Skills 91. Proper writing a program of switch statement.

Proposed date
Date of Demonstration
Preparation
1) Material Windows xp latest version pc
2) Tools & Equipments
3) Other requirement
Review Writing a program using break & continue statement.
Link Application of the relevant rules.
Motivation Must be able to write the program as accurately as
possible.
Presentation Explanation of the switch statement s on the
blackboard and confirm that all the trainees have
understood the same.

Procedure(doing) Information points & Spot Hint/ Question


Safety (Telling) (Asking/ Showing)
Chapter No. 1. invoke TC-IDE.  Write a program to
Procedure : switch 2. key the following print the name of the
statement. program in a new file. month by getting the
main() choice in integers.
{
Int a,b,result;
Int choice;
Printf(“ Enter two numbers
for arithmetic operation. : \
n”) ;
Scanf(“%d %d”, &a, &b);
printf(“\n 1. ADDITION\n”);
printf(“\n 2. SUBTRACTION\
n”);
printf(“\n 3.
MULTIPLICATION\n”);
printf(“\n 4. DIVISION\n”);
printf(“Enter your choice (1-
4)…..\n”);
scanf(“%d”,&choice);
switch(choice)
{
Case 1:
Result=a+b;
Break;
Case 2:
Result=a-b;
Break;
Case 3:
Result=a*b;
Break;
Case 4:
Result=a/b;
Break;
default :
printf(“Not a valid choice \
n”);
break;
}
Printf(“ the result is %d” ,
result);
}
7. Save the program as
BREAK.C
Compile the program to
check for errors & run

Application: Relevant rules should be applied while doing practical of switch


statement.

Summary Accuracy in writing a program using switch program.

Participation of Participation of the trainees encouraged.


the trainees.

Demonstration Plan

Institute I.T.I.
Name of the Instructor
Trade COPA
Objective Writing the program to define the one dimensional
array.
Skills 92. Proper writing the program using one
dimensional array.
Proposed date
Date of Demonstration
Preparation
1) Material Windows xp latest version pc
2) Tools &
Equipments
3) Other requirement
Review Writing a program using switch statement.
Link Application of the relevant rules.
Motivation Must be able to write the program as accurately as
possible.

Presentation Explanation of the one dimensional array on the


blackboard and confirm that all the trainees have
understood the same.

Procedure(doing) Information points & Spot Hint/ Question


Safety (Telling) (Asking/ Showing)
Chapter No. 1. Invoke TC-IDE.  Write a program using
Procedure: One 2. key in the following array to display the
dimensional array. program in a new file. square of each no.
/* program to find the stored in an array.
largest & smallest no.*/
main()
{
int i ,n;
float a[10], large=0,
printf(“\n Enter the size of
the array : “);
scanf(“%d”, &n);
printf(“Enter the elements
…..\n”);
for(i=0;i<n;i++)
{
scanf(“%f”, &a[i]);
large=a[0];
}
for (i=0;i<n;i++)
{
if (a[i]>large)
large=a[i];
}

8. Save the program as


BREAK.C
Compile the program to
check for errors & run

Application: Relevant rules should be applied while doing the practical of


one dimensional array.

Summary Accuracy in writing a program using one dimensional array.

Participation of Participation of the trainees encouraged.


the trainees.
Demonstration Plan

Institute I.T.I.
Name of the Instructor
Trade COPA
Objective Writing the program to define two dimensional array.
Skills 93. Proper writing the pogram using two dimensional
array.

Proposed date
Date of Demonstration
Preparation
1) Material Windows xp latest version pc
2) Tools & Equipments
3) Other requirement
Review Writing a program using two dimensional array.
Link Application of the relevant rules.
Motivation Must be able to write the program as accurately as
possible.
Presentation Explanation of the two dimensional array on the
blackboard and confirm that all the trainees have
understood the same.

Procedure(doing) Information points & Spot Hint/ Question


Safety (Telling) (Asking/ Showing)
Chapter No. 1. invoke TC-IDE.  Write a 2-D
Procedure:- two 2. key the following array program to get
dimensional array. program in a new file. 5 subjects of 5
/* matrix addition */ student marks & print
main() the total & average of
{ each student.
Int a[2][2], b[2][2], c[2][2];
Int i,k;
Printf(“Enter the first matrix
a[2][2] \n”);
for(i=0; i<2;i++)
{
for (k=0;k<2;k++)
{
scanf(“%d”,&a[i][k];
}
}
printf(“Enter the second
matrix b[2][2]\n”);
for (i=0;i<2;i++)
{
for (k=0;k<2;k++)
{
scanf(“%d”,&b[i][k];
}
}
for (i=0;i<2;i++)
{
for (k=0;k<2;k++)
{
c[i][k]=a[i][k]+b[i][k];
}
}
Printf(“The sum of two
matrices A & B is \n”);
for (i=0;i<2;i++)
{
for (k=0;k<2;k++)
{
printf (“%d\t”,c[i][k]);
}
Printf(“\n”);
}
}
9. Save the program as
MATRIX.C
Compile the program to
check for errors & run

Application: Relevant rules should be applied while doing practical of two


dimensional array.

Summary Accuracy in writing a program using two dimensional array.

Participation of Participation of the trainees encouraged.


the trainees.

Demonstration Plan

Institute I.T.I.
Name of the Instructor
Trade COPA
Objective Writing the program to define “char” data type & char
array to accept strings from keyboard Display &
process strings . Use various string functions to
manipulate strings.
Skills 94. Proper writing the program using “char” data
type & char array to accept strings from keyboard
Display & process strings . Use various string
functions to manipulate strings.
Proposed date
Date of Demonstration
Preparation
1) Material Windows xp latest version pc
2) Tools &
Equipments
3) Other requirement
Review Writing a program using “char” data type & char array
to accept strings from keyboard Display & process
strings . Use various string functions to manipulate
strings.
Link Application of the relevant rules.
Motivation Must be able to write the program as accurately as
possible.
Presentation Explanation of the“char” data type & char array to
accept strings from keyboard Display & process
strings . Use various string functions to manipulate
strings.on the blackboard and confirm that all the
trainees have understood the same.

Procedure(doing) Information points & Spot Hint/Question


Safety (Telling) (Asking/Showing)
PROCEDURE:- 1. Invoke TC-IDE. Write a program to get
Program using 2. Key the following the name as input &
“char” data type & program in a new file. print using the
char array to /* declare & initialize the strings specifiers?
accept strings from */
keyboard Display main()
& process strings . {
Use various string char str1[16]=”STRING
functions to HANDALING”;
manipulate strings. printf(“\n\n”);
printf(“%16s\n”,str1);
printf(“%5s\n”,str1);
printf(“%16.6s\n”,str1);
}
* Save the program as
STRGHAND.C
* Compile the program to check
for errors & run
/* reading & writing strings */  Write a
main( ) program to get
{ Employee details
char name[25],addr[40], & printing them
design[20]; separately?
printf(“Enter name, address &
designation \n”);
scanf(“%s %s %s”, name,
addr,design);
printf(“\n Name=%s \n
Address=%s \n Designation=
%s”,name, addr,design);
}
* Save the program as
READSTR.C
* Compile the program to check
for errors & run
/* copying one string to another
using strcpy*/
main()
{
char str[25],dest[25];
printf(“\n Enter a string :”);
gets(str);
strcpy(dest,str);
printf(\n The Source string is
%s “,str);
printf(\n The Destination string
is %s “,dest);
}
* Save the program as
STRCPY.C
* Compile the program to * Write a program to
check for errors & run get address1 of a
/* length of string using strlen() employee as input &
function. */ copy to another
main () string address2?
{
int x;
char str[20];
printf(“\n Enter a string : “);
gets(str);
x=strlen(str);
printf(“\n The length of string is
= %d”, x);
}
10. Save the program as
STRLEN.C
Compile the program to check
for errors & run
/* Concatinating the strings */
main()
{
char str1[25],str2[25], *str3;
printf(“Enter a string :”);
gets(str1);
printf(“\n Enter another
string :”);
gets(str2);
str3=strcat(str1,str2);
printf(“\n The concatenated
string is :%s “,str3);
}
* Save the program as
STRCAT.C
* Compile the program to
check for errors & run
/* comparision of strings */
main()
{
char str1[20],str2[20]; * write a program ot
int x; get two strings as
printf(“Enter a string :”); input & compare them
gets(str1); ot give smaller string?
printf(“\n Enter another
string :”);
gets(str2);
x=strcmp(str1,str2);
if (x==0)
puts(“strings are equal “);
else
printf(“strings are not equal “);
}

* Save the program as


STRCMP.C
* Compile the program to
check for errors & run

Application: Relevant rules should be applied while doing practical of char


data type & string handling.

Summary Accuracy in writing programs using char data type string


functions.

Participation of Participation of the trainees encouraged.


the trainees.

Demonstration Plan

Institute I.T.I.
Name of the Instructor
Trade COPA
Objective Writing the program define & process two
dimensional char array.
Skills 95. Proper writing the program define & process
two dimensional char array.

Proposed date
Date of Demonstration
Preparation
1) Material Windows xp latest version pc
2) Tools & Equipments
3) Other requirement
Review Writing a program using “char” data type & char
array to accept strings from keyboard Display &
process strings . Use various string functions to
manipulate strings.

Link Application of the relevant rules.


Motivation Must be able to write the program as accurately as
possible.
Presentation Explanation of define & process two dimensional
char array..on the blackboard and confirm that all
the trainees have understood the same.

Procedure(doing) Information points & Spot Hint/ Question


Safety (Telling) (Asking/ Showing)
Procedure :- define & 1.Key in the following Writing
process two dimensional program in a new file.
char array. Main()
{
int I,j;
int

Application: Relevant rules should be applied while doing shorthand


practical.

Summary Accuracy in reading, copying, writing and transcription.

Participation of Participation of the trainees encouraged.


the trainees.

Demonstration Plan

Institute I.T.I.
Name of the Instructor
Trade COPA
Objective Writing of the program using user defined functions,
pass parameters to & receive return type from
functions.
Skills 96. Proper writing of the program using user
defined functions, pass parameters to & receive
return type from functions..

Proposed date
Date of Demonstration
Preparation
1) Material Windows xp latest version pc
2) Tools & Equipments
3) Other requirement
Review Writing a program using “char” data type & char
array to accept strings from keyboard Display &
process strings . Use various string functions to
manipulate strings.

Link Application of the relevant rules.


Motivation Must be able to write the program as accurately as
possible.
Presentation Explanation of . user defined functions, pass
parameters to & receive return type from
functions on the blackboard and confirm that all
the trainees have understood the same.

Procedure(doing) Information points & Spot Hint/ Question


Safety (Telling) (Asking/ Showing)
Procedure:- 1. invoke TC-IDE.  Writing
user defined 2. key the following program in a the function
functions, new file. multiply() & divide()
pass /* User defined function */  Explan
parameters to main() ation to be given by
& receive { applying the relevant
return type match ( ); rules when students
from printf (“You deserve to win !”) ; find it difficult to read
functions.. } accurately.
) match ( ) /* User defined function */
{
printf (“\n Won the match \n”);
}
Save the program as FUNCT1.C
Compile the program to check for
errors & run the program to get the
output.

/*Function using arguments & no


return value */
main ()
{
name ( );
}
void name ( )
{
char empname [25];
printf (“\n Enter he employee
name :”);
scanf (“%s”, empname );
printf (\n The Employee name is
%s”,empname );
}
Save the program as NEARGRET.C
/*Function with arguments & no
return value*/

Void main ( )
{
Void simple (float x, floaty, intz);
flot principle, rate ;
int year ;
printf (/nEnter the principle, rate of
interest & no of years \n);
scanf (“%f %f %d”,& principle, & rate
& year );
simple (principle, rate, year);
}
void simple (float x, float y, int z)
{
flot simp _ int =0.0
simp _int = (x*y*z)/100;
printf (\n simple interest is
%2f”,simp_int);
}

* Save the program as


ARGNORET.C
* Compile the program to check for
errors & run the program to get the
output.

/* function with arguments & return


values */
main()
{
int a;
print(“\n Enter the value :”);
scanf(“%d”,&a );
printf(“\n sum of first %d natural nos.
is %d “,a);
sum(a);
}

int sum( int x)


{
int i ,result =0;
for (i=1; i<=x; i++)
{
Result=result+1;
}
Return(result);
}
 Save the program as
ARGRET.C
 Compile the program to
check for errors & run the program to
get the output.
/* Functions using call by value */
1 invoke the TC-IDE
2 key in the following program in a
new file

/* sum of digits of a number */


main ()
{
int sumofdigits (int) ;
int num, sum;
printf (“Enter the number \n”);
scanf (“%d”, &num):
sum = sumofdigits (num);
printf (“Sum of the digits of the no is :
%d”, sum);
}
int sumofdigits (int n )
{
float digit;
int count= 0;
int s = 0;
while (n!=0)
{
digit=n%10;
count ++ ;
s=s+digit;
n=n/10;
}
printf (“\n The no of digits in the no =
%d”, count);
return (s);
}
3 Save the program as CALLVAL.C
4 Compile the program to check for
errors and run the program to get the
output

/* Functions with call by reference */


1 Key in the following program in a
new file

/* swapping two numbers*?


Main()
{
int a = 5, b=10;
printf (“ a=%d and b=%d\n”, a,b);
Swap (&a, &b);
printf (“a = %d and b=%d \n”, a,b);
}
Swap (int *a ,int *b)
{
int temp ;
temp = *a ;
*a = *b ;
*a =*b ;
*b = temp :
}

2 Save the program as SWAP.C


3 Compare the output with the result
given below:
a = 5 and b = 5
a = 10 and b= 10

Application: Relevant rules should be applied while doing shorthand


practical.

Summary Accuracy in reading, copying, writing and transcription.

Participation of Participation of the trainees encouraged.


the trainees.

Demonstration Plan

Institute I.T.I., AUNDH, PUNE 7


Name of the Instructor MRS. A.S. JOGAIKAR
Trade COPA
Objective Writing the program using pointers , Manipulate data
using pointers. Pass pointers to Function.
Skills 97. Program using pointers, Manipulate data
using pointers. Pass pointers to Function.
Proposed date 10/05/2010
Date of Demonstration 24/05/2010
Preparation
1) Material Windows xp latest version pc
2) Tools & Equipments
3) Other requirement
Review Writing a program using user defined functions, pass
parameters to & receive return type from functions
Link User defined function
Motivation Write the program using user defined function
Presentation Explanation of . using pointers , Manipulate data using
pointers. Pass pointers to Function.

Procedure(doing) Information points & Spot Hint/ Question


Safety (Telling) (Asking/ Showing)
/* Accessing the address of a variable
Define Pointers. */ 1 Invoke the TC-IDE
Manipulate data main ()
using pointers. { Int a= 5, b= 10, *ptr ; 2 Key in the
Pass pointers to Ptr =&a ; program in a new file:
Function Printf (“\n The initial value of a = %d
and b=%d”, a, b);
b = *ptr ;
printf (“\n The changed value of a =
%d and b= %d”, a, b);
printf (“\n The value of ptr is %ld”, ptr); 3 Save the program
printf (“\n The value of as POINTER 1.C
address of a is %ld”, &a);
Printf (“\n The value of *ptr is %d”, 4 Compile the
*ptr); } program to check for
/*Declaring and initialising pointers */ errors and run the
main () program to get the
{ int i. j; output
int *pj = &j, *pi=&i ;
i=20;
j=25 ;
printf (“\n The initial value of i & J : %d
%d”,i, j);
printf (“\n The initial value of *pi and
*pj : %d %d “,*pi, *pj);
*pj=j+5 ;
I = *pj +5 ;
*pi = i+j ;
printf (“\n The final value of I and J : Save the program as
%d %d”,i, j); POINTER2.C
printf (“\n The final value of *pi & *pj : Compile the program
%d %d “,*pi, *pj); } to check for errors
/* Accessing variables through pointer and run the program
*/ to get the output
main()
{ int m, n ;
int *ptr ;
m=50;
ptr=&m ;
n =*ptr ;
Printf (“Value of M is %d \n \n”, m) ; Save the program as
Printf (“%d is stored at address %u” , POINTER3.C
m, &m) ; Compile the program
Printf (“%d is stored at address %u” , to check for errors
*ptr, ptr); and run the program
Printf (“%d is stored at address %u” \ to get the output
n” , ptr, &ptr);
Printf (“%d is stored at address %u” \
n”, n, &n);
*ptr =10 ;
Printf (“in The value of m now = %d \n”
,m); }

Application: Relevant rules should be applied while doing practical of using


pointers , Manipulate data using pointers. Pass pointers to
Function.

Summary Accuracy in doing practical of using pointers , Manipulate data


using pointers. Pass pointers to Function.

Participation of Participation of the trainees encouraged.


the trainees.

Demonstration Plan

Institute I.T.I.
Name of the Instructor
Trade COPA
Objective Writing the program for defining structure , accept &
display data from structure.
Skills 98. Proper Writing the program for defining structure ,
accept & display data from structure.
Proposed date
Date of Demonstration
Preparation
1) Material Windows xp latest version pc
2) Tools & Equip.s
3) Other requirement
Review Writing a program using user defined functions, pass
parameters to & receive return type from functions
Link Application of the relevant rules.
Motivation Must be able to write the program as accurately as
possible.
Presentation Explanation of . Writing the program for defining
structure , accept & display data from structure. on the
blackboard and confirm that all the trainees have
understood the same.

Procedure(doing) Information points & Spot Hint/ Question


Safety (Telling) (Asking/ Showing)
Procedure Structures
/* Defining the structure*/
Main () 1 Invoke the TC-IDE
{ Struct data 2 Key in the following
{ Int abc ;} x,y ; program in a new file:
x.abc =500 ; 3 Save the program as
y=x; INTIAL.C
printf (“\n Value = %d”, y.abc) ; } 4 Compile the program
Array of structures to check for errors and
Void main() Run the program to get
{ Struct employee the output.
{ Int empno ;
Char empname [20] ; } ;
Int i ;
Struct employee emp [20] ;
Printf (“\n Enter Empno &
Empname for two employees \n”) ;
For (i = 0 ; i <2 ; i++)
Scanf (“%d %s”,
&emp[i].empno,emp[i].empname) ;
Printf (“\n The Empno and
Empname are :\n”) ;
For (i=0 ; i<2 ; i++)
Printf (“%d \t %s \n”,
emp[i].empno,emp[i].empname); }

Application: Relevant rules should be applied while doing practical.

Summary Accuracy in reading, copying, writing .

Participation of Participation of the trainees encouraged.


the trainees.

You might also like