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