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 is meant by inheritance?
given post order,in order construct the corresponding binary tree
What does int main () mean?
what does static variable mean?
an expression contains relational operators, assignment operators, and arithmatic operstors. In the absence of parentheses, they will be evaluated in which of the following order a) assignment, relational, arithematic b) arithematic, relational, assignment c) relational, arithematic, assignment d) assignment, arithematic, relational
Where we use clrscr in c?
How can I recover the file name given an open stream or file descriptor?
Is this program statement valid? INT = 10.50;
What is the difference between variable declaration and variable definition in c?
What is a good way to implement complex numbers in c?
What is the right type to use for boolean values in c?
What is dynamic memory allocation?
Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.
How can I handle floating-point exceptions gracefully?
When should structures be passed by values or by references?