Friday, May 3, 2013

Base current,Base voltage,Base impedence flow

ZB=VB/IB   [where IB=(VA)B/VB)]
VB=ZB*IB
IB=VB/ZB
 #include<stdio.h>
main()
{
    char m;
    float a,b,c,d,sum=0.0;
    c=d/b;
    printf("\n\t-:IT'S A PROGRAM FOR BASE CURRENT ,VOLTAGE AND IMPEDENCE:-\n");
    printf("  _________________________________________________________________\n");
    printf("  For ZB=VB/IB press 'A',For VB=ZB*IB press'B' and For IB=ZV/VB press 'C'\n");
    printf("__________________________________________________________________________\n");
    scanf("%c",&m);
    switch(m)
    {
        case'A':
        printf("\nEnter the value of VB:");
        scanf("%f",&b);
        printf("\nEnter the value of IB:");
        scanf("%f",&c);
        sum=(b/c);
        printf("\n\tZB:-%f\n",sum);
        break;
        case'B':
        printf("\nEnter the value of ZB:");
        scanf("%f",&a);
        printf("\nEnter the value of IB:");
        scanf("%f",&c);
        sum=(a*c);
        printf("\n\tVB:-%f\n",sum);
        break;
        case'C':
        printf("\nEnter the value of ZB:");
        scanf("%f",&a);
        printf("\nEnter the value of VB:");
        scanf("%f",&b);
        sum=(a/b);
        printf("\n\tIB:-%f\n",sum);
        break;

    }

}

Voltage:Sum of total voltage in circuit.

Write a program in c to find total voltage in circuit
  V=V1+V2+V3+.....+Vn 




#include<stdio.h>
main()
{
    int V,I,R,n,sum=0,i;
    printf("\n\tIT'S A PROGRAM TO FIND THE TOTAL VALUE OF VOLTAGE IN A CIRCUIT\n");
    printf("\n\tEnter the range value of series:");
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
        printf("\nEnter the  value of current:");
        scanf("%d",&I);
        printf("\nEnter the value of resistance:");
       scanf("%d",&R);
       V=(I*R);
       sum+=V;
    }
   printf("\n\tTotal voltage is: %d\n",sum);
   return 0;
}