Created
May 25, 2022 14:11
-
-
Save Dbhardwaj99/55ba8c87380f40817e73a6d44042e750 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
int i,num,rem,count; | |
int ar[50]; | |
printf("Enter the number:\n"); | |
scanf("%d",&num); | |
count = 0; | |
i = 0; | |
while(num!=0){ | |
rem = num%10; | |
num = num-rem; | |
num = num/10; | |
if(rem>5){ | |
ar[i] = rem; | |
++count; | |
++i; | |
} | |
} | |
printf("There are %d-digits which are more than 5. The digits are: ",count); | |
for(i=0;i<count;--count) | |
{ | |
printf("%d ",ar[count-1]); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment