ent-2:rgb(var(--color_42));--wst-color-fill-accent-3:rgb(var(--color_43));--wst-color-fill-accent-4:rgb(var(--color_44));--wst-color-fill-background-primary:rgb(var(--color_11));--wst-color-fill-background-secondary:rgb(var(--color_12));--wst-color-text-primary:rgb(var(--color_15));--wst-color-text-secondary:rgb(var(--color_14));--wst-color-action:rgb(var(--color_18));--wst-color-disabled:rgb(var(--color_39));--wst-color-title:rgb(var(--color_45));--wst-color-subtitle:rgb(var(--color_46));--wst-color-line:rgb(var(--color_47));--wst-font-style-h2:var(--font_2);--wst-font-style-h3:var(--font_3);--wst-font-style-h4:var(--font_4);--wst-font-style-h5:var(--font_5);--wst-font-style-h6:var(--font_6);--wst-font-style-body-large:var(--font_7);--wst-font-style-body-medium:var(--font_8);--wst-font-style-body-small:var(--font_9);--wst-font-style-body-x-small:var(--font_10);--wst-color-custom-1:rgb(var(--color_13));--wst-color-custom-2:rgb(var(--color_16));--wst-color-custom-3:rgb(var(--color_17));--wst-color-custom-4:rgb(var(--color_19));--wst-color-custom-5:rgb(var(--color_20));--wst-color-custom-6:rgb(var(--color_21));--wst-color-custom-7:rgb(var(--color_22));--wst-color-custom-8:rgb(var(--color_23));--wst-color-custom-9:rgb(var(--color_24));--wst-color-custom-10:rgb(var(--color_25));--wst-color-custom-11:rgb(var(--color_26));--wst-color-custom-12:rgb(var(--color_27));--wst-color-custom-13:rgb(var(--color_28));--wst-color-custom-14:rgb(var(--color_29));--wst-color-custom-15:rgb(var(--color_30));--wst-color-custom-16:rgb(var(--color_31));--wst-color-custom-17:rgb(var(--color_32));--wst-color-custom-18:rgb(var(--color_33));--wst-color-custom-19:rgb(var(--color_34));--wst-color-custom-20:rgb(var(--color_35))}.wix-presets-wrapper{display:contents}
top of page

#include<iostream>
#include<math.h>

using namespace std;
int main()
{
    int opcion;
    cout<<"******************menu************* \n";
    cout<<"1) opcion 1 :serie numerica usando while\n";
    cout<<"2) opcion 2 :serie numerica usando do \n";
    cout<<"3) opcion 3 :serie 1 \n";
    cout<<"4) opcion 4 :serie 2 \n";
    cout<<"5) opcion 5 :serie 3\n";    

    cin>>opcion;
    switch(opcion)
    
{

    case 1:  //usando while
       {
       cout<<"opcion1"<<endl;
       cout<<endl<<endl;
       //declaración
       int fact,n,m;
       double suma;
       //inicializacion
        n=1;
        suma=0;
        fact=1;
        //proceso
        while (n<=7)
          {
            fact = fact*n;
            suma = suma + fact/(2*n-1);//acoluladores
            n = n+1;
            cout<<"factorial =" <<fact<<endl;
            cout<<"suma ="<<suma<<endl;
          }

       };break;
       
       
    case 2:
       {
       cout<<"opcion2"<<endl;
       cout<<endl<<endl;
       //declaración
       int fact,n,m;
       double suma;
       //inicializacion
        n=1;
        suma=0;
        fact=1;
        //proceso
        do
          {
                          n = n+1;
            fact = fact*n;
            suma = suma + fact/(2*n-1);//acoluladores

            cout<<"factorial =" <<fact<<endl;
            cout<<"suma ="<<suma<<endl;
          
          }while (n<=15);
       };break;
        
        case 3:
          {

           cout<<"opcion3"<<endl;
           cout<<endl<<endl;
           //declaración
           int n,m;
           double suma;
            //inicializacion
            n=1;
           suma=0;
           //proceso
           while (n<=65)
          {
            suma = suma + (2*n)+(2*n-1);//acoluladores
            n = n+1;
            cout<<"suma ="<<suma<<endl;
          }

 
    case 4:
      {
       cout<<"opcion4"<<endl;
       cout<<endl<<endl;
       //declaración
       int n,m,fact;
       double suma;
       //inicializacion
        n=1;
        suma=0;
        fact=1;
        //proceso
        while (n<=10)
          {
              fact = fact*n;
            suma = suma + fact+n;//acoluladores
            n = n+1;
            cout<<"suma ="<<suma<<endl;
            cout<<"factorial= "<<fact<<endl;
            
      }

       };break;
     
           case 5:
        {
       
           cout<<"opcion5"<<endl;
           cout<<endl<<endl;
           //declaración
           int x,m;
           double suma,RAD,PI=3.14,a,b,X;
           //inicializacion
           x=10;
           suma=0;
           //proceso
           while (x<=52)
           {
                 RAD=(2*PI*X)/360;
              a=2*pow(sin (RAD),2);
              b=cos(2*RAD);
                suma=suma+a+b;//acoluladores
            x = x+1;
            cout<<" resulado= "<<suma<<" cuando el angulo es: " <<x<<endl;   
            //cout<<endl<<endl;        
}
           };break;

}
return 0;
}
}

evp6.png

© 2023 para Skyline

Creado conWix.com

bottom of page