return-value tag

3 questions


1 answers
78 views
0
To return one or more values in a function

What kind of method do you use to return multiple values in a function?The method I'm using is as follows.def f(x): y0 = x + 1 y1 = x * 3 y2 = y0 ** y3 return (y0,y1,y2)When there are more elements, i...


1 answers
122 views
0
How do I return to generic type in the method?

If you look at the same example below in the OOP book, If you have an Animal class, each animal has several friends. And the subclasses are Dog, Duck, Mouse, etc. Each of them makes a bark(), a quack(...

1 years ago

1 answers
71 views
0
C언어 팩토리얼 재귀함수 구현 시 return 1의 의미가 뭔가요?

#define _CRT_SECURE_NO_WARNIGS#include<stdio.h>#include<stdlib.h>int factorial(int n);int main() { int n; scanf(%d, &n); printf(%d\n, factorial(n)); return 0;}int factorial(int n) { if...


© 2024 OneMinuteCode. All rights reserved.