top of page

estructuras selectivas

22/05/18

#include <iostream>
#include <math.h>
using namespace std;
int main ();
   
           case 1:
                {
              double SUMA;
                int c, m, n, F;
                cin>>m;
                SUMA=0;
                F=1;
                n=1;
                while (n<=m)
                {
                F=F*n;
                SUMA=SUMA+((2*n-1)/F);
                n=n+1;
                }
                cout<<"LA SUMA ES: "<< SUMA <<endl;
                };break;
                
                
                
                
                
           case 2:
               
               
               
               
                {
                double x, SUMA, PI=3.1415;
                int m, S;
                S=90;
                m=180;
                SUMA=0;
                while (S<=m)
                {
                x=(S*2*PI)/360;
                SUMA=SUMA+(cosh(x)-sin(x));
                S=S+10;
                cout<<"LA SUMA ES: "<< SUMA <<endl;
                }
                };break;
                
                
                
           case 3:
               
               
               
                {
                double SUMA;
               int m, n;
                n=8;
                m=20;
               SUMA=0;
                while (n<=m)
                {
                SUMA=SUMA+(2*n)+(2*n-1);
                n=n+1;
                cout<<"LA SUMA ES: "<< SUMA <<endl;
                
                } break;
                             
                system ("pause");
                return 0;
                            }

practica 1

04/06/18

#include<iostream>
#include<math.h>
using namespace std;
int main();

    
  case 1:
        {
            double i,pi=3.14,t,vp,w,c;
            cout<<"voltaje";cin>>vp;
            cout<<" velocidad angular";cin>>w;
            cout<<"capacitancia";cin>>c;
            t=6;
            do
            {
                i=vp*w*c*cos((w*t)+(pi/2));
                cout<<i<<endl;
                t=t+3;
            }
            while(t<=20);
        };
        break;
        
        
case 2:
        {

            double r,l,c,w,i;;
            cout<<"ingrese 1";cin>>r;
            cout<<"ingrese ";cin>>l;
            cout<<"capacitancia"; cin>>c;
             i=5;
            do
            {
                a=(w*l-(1/(w*c)));
                cout<<"z="<<r<<"+i"<<i<<endl;
                i=i+3;
            }
        
            while(i<=15);
        };
        break;
        
        
    case 3:
        {
            double il,x1,x2,w,l,pi=3.14,t;
        cout<<" voltaje ";cin>>v1;
            cout<<" voltaje ";cin>>v2,
            cout<<"ingresar";cin>>l;
            w=10;
            do
            {
                il=((x2-x1)/(w*l)*sin(w*t-pi/2));
                cout<<il;
                w=w+10;
            }while(w<=100);
        };break;
    
}//fin del switch
    
        system("pause");
        return 0;    
 

© 2023 by Ingredients. Proudly created with Wix.com

  • Black Facebook Icon
  • Black Twitter Icon
  • Black Instagram Icon
bottom of page