so i did a small change and it ended up like this
Code:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
void main(void)
{
//declaration
int Np00000, Ns00000;
float Vp00000, Vs00000;
char A, B, C, D, reply;
//intialization
printf("A : Primary Voltage");
printf("\nB : Secondary Voltage");
printf("\nC : Number of Primary windings/coils");
printf("\nD : Number of Secondary windings/coils");
printf("\n\nWhich of the above component are you finding?(A , B , C or D) : ");
scanf("%c",&reply);
if (reply == 'A')
{
printf("\nThis program calculates the Primary Voltage(Vp) of a transformer.");
printf("\n\nEnter the number of coils in the Primary(Np): ");
scanf("%d", &Np00000);
printf("\n\nEnter the number of coils in the Secondary(Ns): ");
scanf("%d", &Ns00000);
printf("\nEnter the voltage in the Secondary (in Volts): ");
scanf("%f", &Vs00000);
//calculation
Vp00000 = Np00000 * Vs00000 / Ns00000;
//output
printf("\n\nThe Primary Voltage(Vs) is %.2f V.", Vp00000);
}//end of A
if (reply == 'B')
{
printf("\nThis program calculates the Secondary Voltage (Vs) of a transformer.");
printf("\nEnter the number of turns in the Secondary(Ns): ");
scanf("%d", &Ns00000);
printf("\n\nEnter the number of turns in the Primary(Np): ");
scanf("%d", &Np00000);
printf("\nEnter the voltage in the primary winding(Vp) (in Volts): ");
scanf("%f", &Vp00000);
//calculation
Vs00000 = Ns00000 * Vp00000 / Np00000;
//output
printf("\n\nThe Secondary Voltage(Vs) is %.2f V.", Vs00000);
}//end of B
if (reply == 'C')
{
printf("\nThis program calculates the number of Primary winding/coils of a transformer.");
printf("\n\nEnter the voltage in the Primary winding(Vp) (in Volts): ");
scanf("%f", &Vp00000);
printf("\nEnter the number of turns in the Secondary winding/coils: ");
scanf("%d", &Ns00000);
printf("\nEnter the voltage in the Secondary winding/coils(Vs) (in Volts): ");
scanf("%f", &Vs00000);
//calculation
Np00000 = Ns00000 * Vp00000 / Vs00000;
//output
printf("\n\nThe number of Primary turn(s) is %d.", Np00000);
}//end of C
if (reply == 'D')
{
printf("\nThis program calculates the number of Secondary winding/coils of a transformer.");
printf("\n\nEnter the voltage in the Secondary winding(Vs) (in Volts): ");
scanf("%f", &Vs00000);
printf("\nEnter the number of turns in the Primary winding/coils: ");
scanf("%d", &Np00000);
printf("\nEnter the voltage in the Primary winding/coils(Vs) (in Volts): ");
scanf("%f", &Vp00000);
//calculation
Ns00000 = Np00000 * Vs00000 / Vp00000;
//output
printf("\n\nThe number of Secondary turn(s) is %d.", Ns00000);
}//end of D
exit(0);
}
Looks like the program is working fine now