Print all numbers which has a certain digit in a certain
position
eg:
number=45687
1 number=4
2 number=5
etc

Answer Posted / eranna kybarshi

#include<stdio.h>
#include<conio.h>
void main()
{
int i,n,t,cnt=0;
int num[10];
clrscr();
printf("\nEnter The No.");
scanf("%d",&n);
while(n%10!=0)
{
t=n%10;
num[cnt]=t;
n=n/10;
cnt++;
}
num[cnt]='\0';

for(i=cnt-1;i>-1;i--)
printf("\n %d number= %d",cnt-i,num[i]);
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

program for reversing a selected line word by word when multiple lines are given without using strrev

1929


how do you programme Carrier Sense Multiple Access

1501


Explain is it better to bitshift a value than to multiply by 2?

696


Is c high or low level?

564


What does 2n 4c mean?

690






Explain the red-black trees?

593


Why do we use header files in c?

567


Why is c called c not d or e?

596


What is the value of a[3] if integer a[] = {5,4,3,2,1}?

656


How many types of arrays are there in c?

581


How do you override a defined macro?

678


How can you increase the size of a dynamically allocated array?

632


Difference between MAC vs. IP Addressing

627


What is pointer to pointer in c language?

583


Describe the header file and its usage in c programming?

606