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
Explain Basic concepts of C language?
c program to compute AREA under integral
In c language can we compile a program without main() function?
How can I do serial ("comm") port I/O?
What do you mean by Recursion Function?
Is null equal to 0 in sql?
Write the syntax and purpose of a switch statement in C.
What are the different types of constants?
What is the acronym for ansi?
What is fflush() function?
What is the maximum length of an identifier?
How can I determine whether a machines byte order is big-endian or little-endian?
why return type of main is not necessary in linux
What is the use of bitwise operator?
Explain how to reverse singly link list.