Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int a,b,i,j;
- char ch;
- printf ("Donner le chiffre A: ");
- scanf ("%d",&a);
- printf ("\nDonner le nombre B: ");
- scanf ("%d",&b);
- i=0;
- do{
- j=b%10;
- if (j==a)
- i++;
- b=b/10;
- }while (b/10!=0);
- printf ("Le nombre d'occurences de %d dans %d est %d",a,b,i);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement