Eee C PGM
Eee C PGM
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
…………………………………………………………………………………………...Practical Classes of
REG. NO:
Record should be written neatly in ink on the right hand page only. Left
hand pages being reserved for diagrams and graphs.
a. The date
necessary)
PROGRAM:
#Include<stdio.h>
Void main()
Float V,I,R;
Clrscr();
Scanf(“%f”,&I);
Scanf(“%f”,&R);
V=I*R;
Scanf(“%f”,&V);
Scanf(“%f”,&R);
I=V*R;
Scanf(“%f”,&V);
Scanf(“%f”,&I);
R=V*I;
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();
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;
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();
Scanf(“%f%f%f’,&V,&I&R);
P=V*I;
P=(V*V)/R;
P=I*I*R;
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();
Scanf(“%d%d%d%d%d”,&a,&b,&c,&d,&e);
Sum=a+b=c+d+e;
Aver=sum/5.0;
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();
Scanf(“%d%d%d”,&a,&b,&c);
If(a>b&&a>c)
Large=a;
Else if(b>c)
Large=b;
Else
Large=c;
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();
for(i=0;i<10;i++)
Scanf(“%d”,&a[i]);
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];
Scanf(“%s%s”,name1,name2);
N1=strlen(name1);
N2=strlen(name2);
N=strcmp(name1,name2);
Strcpy(name3,name1);
Strcpy(name4,name2);
Strrev(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()
scanf(“%d%d”,&x,&y);
p=pow(x,y);
sr=sqrt(x);
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();
Scanf(%1f”,&q1);
Scanf(“%1f”,&q2);
Scanf(%1f”,&r);
F=force(q1,q2,r);
getch();
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