APC-PRAC-015.c (969B)
1 /* 2 * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 3 * Repo: https://github.com/notamitgamer/bsc 4 * License: MIT 5 */ 6 7 /* Write a program to display all numbers between lb (lower bound) and up (upper bound) 8 which ends with digit 7 or divisible by 7. */ 9 // File Name - amit0611202501.c (LAB), APC-PRAC-015.c (Local) 10 11 // This code has not been compiled. 12 // If you find any issues, please create a new issue on GitHub regarding them. 13 // Go to this link to create a new issue: https://github.com/notamitgamer/bsc/issues 14 15 #include <stdio.h> 16 17 int main() 18 { 19 int lb, ub, i; 20 printf("Enter the lb, ub : "); 21 scanf("%d %d", &lb, &ub); 22 printf("\nEnds with 7 :"); 23 for (i = lb; i <= ub; i++) 24 { 25 if (i % 10 == 7) 26 { 27 printf(" %d", i); 28 } 29 } 30 printf("\nDivisible by 7 :"); 31 for (i = lb; i <= ub; i++) 32 { 33 if (i % 7 == 0) 34 { 35 printf(" %d", i); 36 } 37 } 38 return 0; 39 }