5
Contributors
4
Replies
25
Views
3 Years
Discussion Span
Last Post by mridul.ahuja
0
#include<stdio.h>
int main(void)
{
    int num, m, div=1, rem, count=0, i,n, a;
    printf("Enter Number: ");
    scanf("%d", &num);
    div=num;
    for(i=1; i<=10; i++)
    {
        div=num;
        while(div!=0)
        {
        rem=div%10;
        div=div/10;


        if(i==rem)
        {
            count++;
        }


        if(i==rem && count>=2)
        {
            printf("\n%d is present %d times", i, count);
        }
        }
    }
    return 0;
}
1

@basit_3 please refrain from just giving code to homework vultures. If they have a problem with code helping them is fine. Just give me the code questions should be ignored.

2

leonardo123, firstly your question is in C not C++, so can we know why is it being asked in C++ forum ? Secondly, we're not here to do your homework. Show us your effort and we'll help you out.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.