You are on page 1of 3

Ex1

#include <iostream>
#include <cctype>
using natespace std;
void uppercase() {
char a[100];
cout << “ Introduceti un cuvant: ”;
cin >> 0;
for {int i-0; I < strlen(a); i++) {
char upper - toupper(a[i]);
cout << upper;
}
}
int main() {
uppercase();
system(“pause>0”);
return 0;
}
Ex2
#include <iostream>

using namespace std;

float medie{float s, float n}


{
return(s/n);
}
int main()
{
int a;
float n, s - 0;
cout << "Numarul de numere este:" ;
cin >> a;
for (int i - 1; i <- a; i++)
{
cin >> n;
s = s + n;
}
cout << "Media este:" << medie(s,a);
}

You might also like