martes, 5 de noviembre de 2019

Programa 2(VOID)

#include <stdio.h>
#include <iostream>
using namespace std;

void ingresar();
void suma();
void impresion();

int n1,n2,n3,s;

int main(){
system("color F0");
ingresar();
suma();
impresion();
return 0;
}

void ingresar(){
cout<<"Ingrese el primer numero"<<endl;
cin>>n1;
cout<<"Ingrese el segundo numero"<<endl;
cin>>n2;
cout<<"Ingrese el tercer numero"<<endl;
cin>>n3;
}

void suma(){
s=n1+n2+n3;
}

void impresion(){
cout<<"La suma es: "<<s<<endl;
}

No hay comentarios:

Publicar un comentario