Skip to content

Justbtech

  • GIS
  • CTPM
  • Machine Learning
  • Privacy Policy

prime numbers

Print the First N Prime Numbers Using a For Loop and Break in C

September 26, 2026 by admin

This program prints prime numbers between 1 and n, stopping once 10 prime numbers have been printed, using a for loop and a break statement. C Program #include <stdio.h> int main() { int n, num, i, count = 0, is_prime; printf(“Enter upper limit n: “); scanf(“%d”, &n); for (num = 2; num

Categories C Programming Tags C programming, lab exam, loops, prime numbers Leave a comment

Recent Posts

  • C Programming & Data Structures: Complete Syllabus Index
  • Recursive Functions in C: Factorial and Fibonacci, Revisited with Recursion Trees
  • Functions in C for Unit III: User-Defined Functions, Inter-Function Communication, Storage Classes, and Scope Rules
  • Sorting in C: Bubble Sort, Selection Sort, and Insertion Sort
  • Searching in C: Linear Search and Binary Search

Recent Comments

No comments to show.

Archives

  • September 2026
  • September 2025
  • October 2024
  • April 2023
  • January 2023

Categories

  • C Programming
  • CTPM
  • GIS
  • Machine Learning
  • Regression Model
  • Uncategorized
© 2026 Justbtech • Built with GeneratePress