0% found this document useful (0 votes)
15 views26 pages

Eee C PGM

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)
15 views26 pages

Eee C PGM

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/ 26

MEENAAKSHI RAMASAMY

POLYTECHNIC COLLEGE
Thathanur (Po), Udayarpalayam (TK), Ariyalur (Dt) – 621 804

LAB RECORD

NAME :……………………………………………………………
REG NO :……………………………………………………………
DEPARTMENT :…………………………………………………………….
SEMESTER/YEAR:……………………………………………………………..
MEENAAKSHI RAMASAMY
POLYTECHNIC COLLEGE
Thathanur (Po), Udayarpalayam (TK), Ariyalur (Dt) – 621 804

BONAFIDE CERTIFICATE
This is to certify that this is the bonafide record of work done by

Selvan / Selvi …………………………………………………………………………………..……….in the

…………………………………………………………………………………………...Practical Classes of

the Institution during the Year…………………………………………….

REG. NO:

STAFF IN CHARGE H.O.D

Submitted for the Board practical Examination is held on …………………………………

INTERNAL EXAMINER EXTERNAL EXAMINER


INSTRUCTION FOR MAINTAINING RECORD NOTE BOOK

Record should be written neatly in ink on the right hand page only. Left
hand pages being reserved for diagrams and graphs.

Records should contain

a. The date

b. Number and name of Experiment

c. The aim of Experiment

d. A list of Apparatus required

e. A description of the experiment in brief

f. The theory part of the experiment in brief

g. Observation (to be entered in neat tabular forms wherever

necessary)

Net sketches of equipments, apparatus and full page graphs should be


given, wherever necessary. Diagrams should be drawn neatly.
CONTENTS
S.NO DATE NAME OF THE EXPERIMENT PAGE MARKS SIGN
CONTENTS
S.NO DATE NAME OF THE EXPERIMENT PAGE MARKS SIGN
EX NO:1

PROGRAM:

#Include<stdio.h>

Void main()

Float V,I,R;

Clrscr();

Printf(“Enter the value of current I\n”);

Scanf(“%f”,&I);

Printf(“Enter the value of resistance R\n”);

Scanf(“%f”,&R);

V=I*R;

Printf(“According to Ohm’s law, V is %8.2fV”,V);

Printf(“\n\nEnter the value of voltage V\n”);

Scanf(“%f”,&V);

Printf(“Enter the value of resistance R\n”);

Scanf(“%f”,&R);

I=V*R;

Printf(“According to Ohm’s law, V is %8.2fV”,V);

Printf(“\n\nEnter the value of voltage V\n”);

Scanf(“%f”,&V);

Printf(“Enter the value of current I\n”);

Scanf(“%f”,&I);

R=V*I;

Printf(“According to Ohm’s law, V is %8.2fV”,V);

Getch();

}
OUTPUT:
### C Program to find Voltage using Ohm’s Law
Enter the Value of Current I =0.05
Enter the value of Resistance R = 10
The required Voltage =0.500000
….Program finished with exit code 0
Press ENTER to exit console.
Ex No:2

PROGRAM:

#Include<stdio.h>

Void main()

Float R1,R2,R3,rtot,tot_r_series,tot_r_par;

Clrscr();

Printf(“enter three resistance value R1,R2andR3\n’’);

Scanf(“%f%f%f’’,&R1,&R2,%R3);

Tot_r_series=R1+R2+R3;

Rtot+1.0/R1+1.0/R2+1.0/R3;

Tot_r_par=1.0/rtot;

Printf(“\n Total resistance in eries is %8.2f ohm’’,tot_r_series);

Printf(“\n Total resistance in parallel is8.2fohm’’,tot_r_par);

Getch();

}
OUTPUT:
Enter Resistance values R1,R2,and R3: 10 20 30
Total Resistance in series: 60.00 ohms
Total Resistance in parallel: 5.45 ohms
EX NO:3

PROGRAM

#Include<stdio.h>

Void main()

Float P,V,I,R;

Clrscr();

Printf(Enter the values of V,I and R\n’’);

Scanf(“%f%f%f’,&V,&I&R);

P=V*I;

Printf(“\nPower using voltage and current is %8.2f W”,P);

P=(V*V)/R;

Printf(“\nPower using voltage and resistance is%8.2f W”,P);

P=I*I*R;

Printf(“\n Power using current and resistance is %8.2f W”,P);

Getch();

}
OUTPUT:
Power using voltage and Current:30.00 watts
Power using voltage and Resistance:27.00 watts
Power using current and Resistance:80.00 watts
EX NO:4

PROGRAM

#include<stdio.h>

Void main()

Int a,b,c,d,e,sum;

Float aver;

Clrscr();

Printf(“Enter five numbers\n”);

Scanf(“%d%d%d%d%d”,&a,&b,&c,&d,&e);

Sum=a+b=c+d+e;

Aver=sum/5.0;

Printf”\nSum of given five numbers=5d”,sum);

Printf(“\nAverage of given five numbers=%8.2f”,aver);

Getch();

}
OUTPUT:
Enter 5 number:
10
20
30
40
50
Sum=150.00
Average=30.00
EX.NO:5

#include<stdio.h>

Void main()

Int a,b,c,large;

Clrscr();

Printf(“Enter three numbers\n”);

Scanf(“%d%d%d”,&a,&b,&c);

If(a>b&&a>c)

Large=a;

Else if(b>c)

Large=b;

Else

Large=c;

Printf(“\nThe largest among given three numbers=%d”,large);

getch();

}
OUTPUT:
Enter three numbers:
45 68 23
68 is the largest number.
EX.NO:6

#include<stdio.h>
Void main() {
int choice;
float C1,C2,C3,ctot,tot_c_series,tot_c_par;
clrscr();
printf(“Enter the capacitance values C1,C2andC3\n”);
scanf(“%f%f%f”,&C1,&C2,&C3);
printf(“\nEnter your choice”);
printf(“\nEnter 1 for series”);
printf(“\nEnter 2 for parallel\n”);
scanf(“%d”,&choice);
switch(choice)
{
Case1:
Ctot=1/C1+1/C2+1/C3;
tot_c_series=1/ctot;
printf(“\nTotal capacitance in series is %8.2f”,tot_c_series);
break;
Case2:
tot_c_par=C1+C2+C3;
print(“\nTotal capacitance in parallel is %8.2f”,tot_c_par);
break;
}
getch
}
OUTPUT :
Enter the capacitance values C1,C2 and C3
10 20 30
Enter your choice
Enter 1 for series
Enter 2 for parallel
1
Total capacitance in series is 5.45
Enter the capacitance values C1,C2 and C3
10 20 30
Enter your choice
Enter 1 for series
Enter 2 for parallel
2
Total capacitance in parallel is 60.00
Ex.no7

PROGRAM

#inliude<stdio.h>

Void main()

Int i,a[10];

Clrscr();

Printf(“Enter 10 numbers one by one\n”);

for(i=0;i<10;i++)

Scanf(“%d”,&a[i]);

Printf(“\nT he entered numbers are\n”);

far(i=0;i<10;i++)

printf(“%d”,a[i]);

getch();

}
OUT PUT :
Enter 10 numbers one by one
10
15
20
25
30
35
40
45
50
55
The entered numbers are
10 15 20 25 30 35 40 45 50 55
EX.NO:8

Void main()

Int n1,n2,n;

Clrscr();

If(n==0)

Else if(n>=0)

Else

Strrev(name1);

PROGRAM

#include<stdio.>

#include<string.h>

Char nam1[20],name3[20,name4[20];

Printf(“Enter two strings\n”);

Scanf(“%s%s”,name1,name2);

N1=strlen(name1);

N2=strlen(name2);

Printf(“\nLength of string%s is%d”,name1,n1);

Printf(“\nLength of string%s is%d”,name2,n2);

N=strcmp(name1,name2);

Printf(“\n Two strings are equal”);

Printf(“\nFirst string is greater than the second string”);

Printf(“\nSecond string is greater than the first string”);

Strcpy(name3,name1);

Strcpy(name4,name2);
Strrev(name2);

Printf(“\nReversed string of%s is%s”,name3,name1);

Printf(“\nReversed string of%s is%s”,name4,name2);

getch();

}
OUT PUT :
Enter two string
Polytechnic
College
Length of string polytechnic is 11
Length of string college is 7
First string is greater than the second string
Reversed string of polytechnic is cinhcetylop
Reversed string of college is egelloc
Ex.No:9

Progrem

#include<stdio.h>

#include<math.h>

Void main()

Int x,y;

float p,sr;

clrscr()

printf(“Enter the value of x and y\n”);

scanf(“%d%d”,&x,&y);

p=pow(x,y);

sr=sqrt(x);

printf(“\n%d power%d is %8.2f”,x,y,p);

printf(“\nSquare root of %d is %8.2f”,x,sr);

getch();

}
OUT PUT :
Enter the value of X and Y
93
9 power 3 is 729.00
Square root of 9 is 3.00
Ex.No:10

Program

#include<stdio.h>

#include<math.h>

#define KE 8.9875E9

Void main()

Double q1,q2,r,f;

Double force(double,double,double);

Clrscr();

Printf(“Enter the value of magnitude q1\n”)

Scanf(%1f”,&q1);

Printf(“\nEnter the value of magnitude q2\n”);

Scanf(“%1f”,&q2);

Printf(“Enter the distance r\n”);

Scanf(%1f”,&r);

F=force(q1,q2,r);

Printf(“\nElectrostatic force according to Coulomb’s Law is %1`fN”,F);

getch();

Double force(double d1,double d2,double dist)

Double F1;

F1=KE*fabs(d1*d2)/(dist*dist);

Return(F1);

}
OUT PUT :
Enter the value of magnitude q1
2 E-6
Enter the value of magnitude q2
3E-6
Enter the Distance r
0.05
Eletrostatic force according to coulomb’s law is 21.570000 N

You might also like