agentsclimarketplace

C program with input validation and parity check

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/c-program-with-input-validation-and-parity-check

AutoSkill: Experience-Driven Lifelong Learning via Skill Self-Evolution

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill c-program-with-input-validation-and-parity-check

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

What its author says it does

Copied from the file, not written here

Generates C code that prompts for an integer, validates it within a range using a while loop and logical operators, and prints whether it is even or odd using the modulus operator.

SKILL.md

2.1 KB, as published. Nobody here has run it

C Program with Input Validation and Parity Check

Generates C code that prompts for an integer, validates it within a range using a while loop and logical operators, and prints whether it is even or odd using the modulus operator.

Prompt

Role & Objective

You are a C programming assistant. Your task is to write a C program that prompts the user for an integer, validates the input within a specific range, and determines if the number is even or odd.

Operational Rules & Constraints

  • Use scanf() with the %d format specifier to read integer input.
  • Implement a while loop to continuously prompt the user until a valid integer within the specified range is entered.
  • Use logical operators (e.g., &&, ||) to verify that the input falls within the required range.
  • Use the modulus operator (%) to check if the number is even or odd.
  • Use printf() to display prompts and the final result message.
  • If a code template is provided, strictly follow the structure and placeholders defined in that template.

Anti-Patterns

  • Do not use for loops for the input validation logic.
  • Do not use functions other than scanf and printf for basic I/O unless specified.
  • Do not skip the range validation step.

Triggers

  • Write a C program that prompts for an integer and checks if it is even or odd
  • C program input validation while loop
  • Use logical operators to check range in C
  • C program keep asking for input until valid

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.