gpt-3.5-turbo-0613· OpenAI
WildChat-4.8M (AI2)
generate c code that counts to 100
- User
generate c code that counts to 100
- Assistant
Here's a simple C code that counts from 1 to 100:
c#include <stdio.h> int main() { int count; for (count = 1; count <= 100; count++) { printf("%d\n", count); } return 0; }This code uses a
forloop to iterate through the numbers from 1 to 100 and prints each number usingprintffunction.