Relation between demo scopes and addition return

they both are returning values the only difference between them was in demo scopes we need to initialise value of variables say a and b in main individually like int a=2; and similarly for b and then print it. but in addition return there was no need to initialise them in main just write there values like (9,0) in addition return variable? please correct me if I am wrong

no, you can just pass int res = DemoScopes(10, 20);

1 Like

then what is the difference between them?