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
Can you please explain the scope of static variables?
Explain what are compound statements?
What is typedf?
What is the difference between abs() and fabs() functions?
write a c program to do the following: a) To find the area of a triangle. b) To convert the temperature from Fahrenheit to Celsius. c) To convert the time in hours : minutes : seconds to seconds.
What are Macros? What are its advantages and disadvantages?
Where are c variables stored in memory?
Write a code to generate divisors of an integer?
List the variables are used for writing doubly linked list program.
Explain what are the standard predefined macros?
2) Write a program that will help Air Traffic Control for an airport to view the sequence of flights ready for take-off. The airport can accommodate 10 flights waiting for take-off at any point in time. Each flight has a unique 3 digit numeric identifier. Each time a flight takes-off, Air Traffic Control adds a flight to the waitlist. Each time a flight is added to the waitlist, the list of flights waiting to take-off must be displayed. When a flight is cleared for take-off, Air Traffic Control removes the flight from the waitlist. Each time a flight takes-off, the list of flights waiting to take-off must be displayed. Sequence of take-off is the sequence of addition to the waitlist
What functions are in conio h?
What does 1f stand for?
What are the types of functions in c?
What are pragmas and what are they good for?