Power: Sum of total Power in Circuit.. P=P1+P2+P3+......+Pn
Where P=(I*I)R
#include<stdio.h>
main()
{
int i,n,j;
float R,I,P=0.0,sum=0.0;
printf("Enter the number which u want to use serise:\n");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=1;j++)
printf("Enter the value of current:\n");
scanf("%f",&I);
printf("Enter the value of resestence:\n");
scanf("%f",&R);
P=(I*I)*R;
}
sum+=P;
printf("The totel Power is:%f",sum);
}
Where P=(I*I)R
#include<stdio.h>
main()
{
int i,n,j;
float R,I,P=0.0,sum=0.0;
printf("Enter the number which u want to use serise:\n");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=1;j++)
printf("Enter the value of current:\n");
scanf("%f",&I);
printf("Enter the value of resestence:\n");
scanf("%f",&R);
P=(I*I)*R;
}
sum+=P;
printf("The totel Power is:%f",sum);
}
No comments:
Post a Comment