Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main(){
- int comp,N=0;
- float MMTF,MMTR,dispc,disps = 1;
- char resp;
- do{
- do{
- printf("DIGITE O NUMERO DE COMPONENTES:\n");
- scanf("%d",&comp);
- if (comp <= 0)
- printf("VALOR INVALIDO\n");
- }
- while(comp<=0);
- for(N=0;N < comp;N++){
- do{
- printf("DIGITE O MMTF DO COMPONENTE %d:\n",N);
- scanf("%f",&MMTF);
- printf("DIGITE O MMTR DO COMPONENTE %d:\n",N);
- scanf("%f",&MMTR);
- if (MMTR <= 0 || MMTR <=0)
- printf("VALOR INVALIDO\n");
- }
- while (MMTF<=0 || MMTR<=0);
- dispc=MMTF/(MMTF*MMTR);
- disps=disps * dispc;
- printf("DISPONIBILIDADE DO COMPONENTE %d = %f\n",N,dispc);
- }
- printf("DISPONIBILIDADE DO SISTEMA É %f\n",disps);
- printf("DESEJA CONTINUAR? S/N\n");
- scanf("%c",resp);
- }while(resp = 'S');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement