bsc

Comprehensive codebase and cou...
Log | Files | Refs | README | LICENSE

APC-PRAC-021.c (1020B)


      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 check special number (sum of digit + product of digit = original number) */
      8 // File Name - amit0711202503.c (LAB), APC-PRAC-021.c (Local)
      9 
     10 // This code has not been compiled.
     11 // If you find any issues, please create a new issue on GitHub regarding them.
     12 // Go to this link to create a new issue: https://github.com/notamitgamer/bsc/issues
     13 
     14 #include <stdio.h>
     15 
     16 int main()
     17 {
     18     int num, temp, sumOfDigit = 0, productOfDigit = 1;
     19     printf("Enter the number to check if it is a special number : ");
     20     scanf("%d", &num);
     21     temp = num;
     22     while (temp > 0)
     23     {
     24         sumOfDigit += temp % 10;
     25         productOfDigit *= temp % 10;
     26         temp /= 10;
     27     }
     28     temp = sumOfDigit + productOfDigit;
     29     if (num == temp)
     30         printf("\nInput %d is a special number.", num);
     31     else
     32         printf("\nInput %d is not a special number.", num);
     33     return 0;
     34 }
© notamitgamer • Site Built: 2026-07-21 13:58:23 UTC • git-mirror commit: 1037f62 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror