Exploring GPT-Generated Variations in C Programming Assignments
Marek Horváth, Lenka Bubeňková, Emília Pietriková · 2025
This study investigates the application of GPT-generated code variations in C programming assignments, focusing on providing students with multiple approaches to solve the same problem. By using prompt engineering, we generated variations in tasks involving mathematical operations, encoding/decoding, and file-based operations. The results showed that while GPT-generated variations can effectively provide functionally correct solutions, offering diverse problem-solving strategies such as recursion and modularization, challenges arise with more complex assignments. Specifically, issues in input validation, numerical precision, and handling advanced data structures were observed, highlighting the limitations of GPT when applied to more complex tasks. Although the use of GPT can accelerate the coding process and broaden student learning, careful review and testing of AI-generated solutions remain essential, particularly for ensuring correctness in more complex programming tasks. These findings suggest that GPT can complement, but not replace, the critical thinking and problem-solving skills required in programming education.