Skip to content
Back to skills

C Program With Input Validation And Parity Check

ASecurity

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.

  • 438 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 30, 2026
ai-agents

Security analysis

A100/100

Scanned May 30, 2026

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

Installs into .claude/skills of the current project.

Are you the author of C Program With Input Validation And Parity Check?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for C Program With Input Validation And Parity Check
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-c-program-with-input-validation-and-parity-check/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-c-program-with-input-validation-and-parity-check)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "b9401830-4318-4738-9383-229e4c102a58"
name: "C Program with Input Validation and Parity Check"
description: "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."
version: "0.1.0"
tags:
  - "C programming"
  - "input validation"
  - "while loop"
  - "modulus operator"
  - "logical operators"
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"
---

# 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

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…