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
What are variables c?
What is structure of c program?
Explain the difference between exit() and _exit() function?
What is pragma in c?
Why c is called a mid level programming language?
Is fortran still used in 2018?
What is difference between function overloading and operator overloading?
Explain the use of fflush() function?
How is null defined in c?
Explain how do you search data in a data file using random access method?
When should a type cast not be used?
What is gets() function?
Do you have any idea about the use of "auto" keyword?
is it possible to create your own header files?
Are the expressions * ptr ++ and ++ * ptr same?