mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-12-02 01:59:23 -06:00
19 lines
442 B
Plaintext
19 lines
442 B
Plaintext
// Type your code here, or load an example.
|
|
varying int square_even(varying int num) {
|
|
if (num % 2 == 0) {
|
|
return num * num;
|
|
} else {
|
|
return num;
|
|
}
|
|
}
|
|
|
|
// Uncomment this if you would like to execute the code
|
|
/*
|
|
extern "C" uniform int main() {
|
|
print("Hello, World!\n");
|
|
print("programCount = %\n", programCount);
|
|
print("square_even(%) = %\n", programIndex, square_even(programIndex));
|
|
return 0;
|
|
}
|
|
*/
|