bsc

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

root / semester_1 / tuition-c / P035.c

P035.c (653B)


      1 /* WAP to input an int number and display the product of the successors
      2 of even digits of the number entered by user. */
      3 
      4 #include <stdio.h>
      5 #include <stdbool.h>
      6 int main()
      7 {
      8     int n, res = 1, temp;
      9     bool status = false;
     10     printf("Enter the number : ");
     11     scanf("%d", &n);
     12     temp = n;
     13     while (temp > 0)
     14     {
     15         if ((temp % 10) % 2 == 0)
     16         {
     17             res *= (temp % 10) + 1;
     18             status = true;
     19         }
     20         temp /= 10;
     21     }
     22     if (!status)
     23         printf("\nThere is no even digits.");
     24     else
     25         printf("\nThe product of the successors of even digits of the number %d is : %d", n, res);
     26     return 0;
     27 }
© notamitgamer • Site Built: 2026-09-05 01:53:16 UTC • git-mirror commit: c170d72 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror