Skip to content

Instantly share code, notes, and snippets.

@BeniaminK
Created November 21, 2014 00:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BeniaminK/81b15883ccd37f9c1973 to your computer and use it in GitHub Desktop.
Save BeniaminK/81b15883ccd37f9c1973 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
struct suma_roznica
{
int suma;
int roznica;
};
suma_roznica licz_sume_i_roznice(int x, int y)
{
suma_roznica a;
a.suma = x + y;
a.roznica = x - y;
return a;
}
int main()
{
int a = 10;
int b = 4;
suma_roznica rezultat = licz_sume_i_roznice(a, b);
cout << "suma: " << rezultat.suma << endl;
cout << "roznica: " << rezultat.roznica << endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment