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 which of the following operators is incorrect and why? ( >=, <=, <>, ==)
What is the scope of global variable in c?
how to find binary of number?
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list
Explain which function in c can be used to append a string to another string?
What is variable and explain rules to declare variable in c?
Give me the code of in-order recursive and non-recursive.
Explain the properties of union.
What is the equivalent code of the following statement in WHILE LOOP format?
What are different storage class specifiers in c?
What do mean by network ?
What are the benefits of c language?
What is typedef?
What are pointers? What are stacks and queues?
What is sorting in c plus plus?