Sikshya Plus Get appGet the app free
Class 10 · Computer Science

Structured Programing in C – Class 10 Computer Science Notes and Solutions

Complete solutions and answers for “Structured Programing in C”, a chapter in Class 10 Computer Science (SEE exam preparation). This page covers The lesson in short, Section A: C Language Tokens, Data Types, and Structure, Section B: Control Structures: Selection and Iteration in C and Section C: Complete Solved C Programs.

  • Free, no login needed
  • 3 min read
  • Updated 20 November 2026

Chapter at a glance

Complete textbook solutions and programming guide for Class 10 Computer Science Unit 12 Structured Programming in C, covering tokens, data types and format specifiers (%d, %f, %c), control structures (if-else, switch, loops), and solved C programs for primes, palindromes, and greatest number.

  • Structure of a C Program: #include, main(), return 0
  • C Tokens: Keywords, Identifiers, Operators
  • Format Specifiers: %d, %f, %c, %lf
  • Control Structures: if-else, switch-case, for, while, do-while
  • Solved C Programs: Primes, Palindromes, Factorial

Exam focus: Writing clean, compilable C code with proper syntax and semicolons, contrasting while and do-while loops, and explaining the role of format specifiers in printf and scanf.

Key formulas and definitions

  • Digit extraction in C: rem = n % 10; n /= 10
On this page (11 sections)
  1. The lesson in short
  2. Section A: C Language Tokens, Data Types, and Structure
  3. StructureStandard Structure of a C Program
  4. Data TypesFundamental Data Types and Format Specifiers
  5. Section B: Control Structures: Selection and Iteration in C
  6. SelectionDecision Making: if-else and switch-case
  7. LoopsIterative Loops in C: for, while, and do-while
  8. Section C: Complete Solved C Programs
  9. C Program 1Program 1: Find the Largest of Three User-Supplied Numbers
  10. C Program 2Program 2: Reverse an Integer and Check for Palindrome
  11. C Program 3Program 3: Check Prime Number

Solutions and answers

Class 10 Computer Science · Unit 12: Structured Programming in C

The lesson in short

C is a foundational, general-purpose, procedural programming language developed by Dennis Ritchie at Bell Laboratories in 1972 that serves as the bedrock of modern system and software engineering.

Offering low-level hardware memory access alongside high-level structured control statements, C is widely utilized in developing operating systems (Linux, Windows kernel), database engines, embedded microcontrollers, and compilers.

This chapter covers C language tokens (keywords, identifiers, constants, operators), basic input/output functions (printf, scanf), conditional selection (if-else, switch), iterative loops (for, while, do-while), and complete solved programming exercises aligned with the CDC Class 10 curriculum.

Section A: C Language Tokens, Data Types, and Structure

StructureStandard Structure of a C Program

A standard C program consists of preprocessor directives, the `main()` function entry point, variable declarations, executable statements, and return statements.

C Program ComponentExample CodePurpose and Explanation
Preprocessor Directive#include <stdio.h>Instructs compiler to include Standard Input Output header file before compilation
Main Functionint main() { ... }The mandatory entry point where execution begins in every C application
Variable Declarationint age; float rate;Allocates memory and specifies data type before use
Executable Statementsprintf("Hello World\n");Performs computations and standard output display
Return Statementreturn 0;Returns exit status code 0 to operating system, indicating successful execution

Data TypesFundamental Data Types and Format Specifiers

Data TypeKeywordStorage SizeFormat SpecifierValue Range
Characterchar1 byte%c-128 to 127 (or ASCII characters)
Integerint2 or 4 bytes%d or %i-32,768 to 32,767 (in 16-bit)
Floating Pointfloat4 bytes%f3.4E-38 to 3.4E+38 (6 decimal precision)
Double Precisiondouble8 bytes%lf1.7E-308 to 1.7E+308 (15 decimal precision)

Section B: Control Structures: Selection and Iteration in C

SelectionDecision Making: if-else and switch-case

ConstructSyntax OutlineApplication Context
if-elseif (condition) { // true } else { // false }Two-way conditional branching based on logical boolean evaluation
else-if Ladderif (c1) { ... } else if (c2) { ... } else { ... }Multi-condition evaluation testing sequential relational conditions
switch-caseswitch (expression) { case 1: ...; break; default: ...; }Efficient multi-way branching against discrete integer or character constants

LoopsIterative Loops in C: for, while, and do-while

Loop TypeSyntaxEvaluation NatureExecution Guarantee
for loopfor (init; cond; step) { ... }Pre-tested entry-controlled loopZero or more times
while loopwhile (cond) { ... }Pre-tested entry-controlled loopZero or more times
do-while loopdo { ... } while (cond);Post-tested exit-controlled loopAt least once, even if condition is initially False

Section C: Complete Solved C Programs

C Program 1Program 1: Find the Largest of Three User-Supplied Numbers

Write a C program to input three numbers and determine the greatest using nested if-else.

#include <stdio.h>

int main() {

int a, b, c, largest;

printf("Enter three integers: ");

scanf("%d %d %d", &a, &b, &c);

if (a >= b && a >= c) {

largest = a;

} else if (b >= a && b >= c) {

largest = b;

} else {

largest = c;

}

printf("The greatest number is %d\n", largest);

return 0;

}

C Program 2Program 2: Reverse an Integer and Check for Palindrome

Write a C program to reverse an integer and verify whether it is a palindrome.

#include <stdio.h>

int main() {

int n, temp, rev = 0, rem;

printf("Enter a positive integer: ");

scanf("%d", &n);

temp = n;

while (temp != 0) {

rem = temp % 10;

rev = rev * 10 + rem;

temp /= 10;

}

printf("Reversed number = %d\n", rev);

if (n == rev) {

printf("%d is a Palindrome number.\n", n);

} else {

printf("%d is NOT a Palindrome number.\n", n);

}

return 0;

}

C Program 3Program 3: Check Prime Number

Write a C program to determine whether a given integer is Prime or Composite.

#include <stdio.h>

int main() {

int n, i, count = 0;

printf("Enter an integer greater than 1: ");

scanf("%d", &n);

if (n <= 1) {

printf("%d is neither prime nor composite.\n", n);

return 0;

}

for (i = 1; i <= n; i++) {

if (n % i == 0) {

count++;

}

}

if (count == 2) {

printf("%d is a Prime number.\n", n);

} else {

printf("%d is a Composite number.\n", n);

}

return 0;

}

Frequently asked questions

What is Structured Programing in C about?

Complete textbook solutions and programming guide for Class 10 Computer Science Unit 12 Structured Programming in C, covering tokens, data types and format specifiers (%d, %f, %c), control structures (if-else, switch, loops), and solved C programs for primes, palindromes, and greatest number.

Which topics are covered in Structured Programing in C?

Class 10 Computer Science “Structured Programing in C” covers: Structure of a C Program: #include, main(), return 0; C Tokens: Keywords, Identifiers, Operators; Format Specifiers: %d, %f, %c, %lf; Control Structures: if-else, switch-case, for, while, do-while; Solved C Programs: Primes, Palindromes, Factorial.

What should I focus on in Structured Programing in C for the exam?

Writing clean, compilable C code with proper syntax and semicolons, contrasting while and do-while loops, and explaining the role of format specifiers in printf and scanf.

What are the key formulas or definitions in Structured Programing in C?

Digit extraction in C: rem = n % 10; n /= 10.

Where can I read the Class 10 Computer Science “Structured Programing in C” solutions?

Right on this page. They are free and you do not need to sign up. For chapter quizzes and the AI tutor, install the Sikshya Plus app.

Study tips

Free for Class 9 to 12

Do not just read it. Practice it.

You have read the solutions for Structured Programing in C. Now test yourself, ask the AI tutor and keep your streak going.

Sikshya Plus chapter quiz screen with class, subject and difficulty options
Sikshya AI personal tutor chat inside the app
Sikshya Plus AI tools screen: question assistant, summarizer, translator, grammar checker
Chapter list with Past Q, materials, posts and books tabs
  • AI quizzes for this chapterTest yourself with instant feedback and explanations after every answer.
  • AI tutor, free, 24/7Stuck on a question? Ask in your own words and get a step-by-step explanation.
  • 14 AI tools in one appSummarizer, grammar checker, flashcards, essay help, math solver and more.
  • Past questions and notesPast papers and your own notes organized chapter by chapter.
Download free on Google Play Scan with your phone to install