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
program for reversing a selected line word by word when multiple lines are given without using strrev
how do you programme Carrier Sense Multiple Access
Explain is it better to bitshift a value than to multiply by 2?
Is c high or low level?
What does 2n 4c mean?
Explain the red-black trees?
Why do we use header files in c?
Why is c called c not d or e?
What is the value of a[3] if integer a[] = {5,4,3,2,1}?
How many types of arrays are there in c?
How do you override a defined macro?
How can you increase the size of a dynamically allocated array?
Difference between MAC vs. IP Addressing
What is pointer to pointer in c language?
Describe the header file and its usage in c programming?