Print all numbers which has a certain digit in a certain
position
eg:
number=45687
1 number=4
2 number=5
etc

Answers were Sorted based on User's Feedback



Print all numbers which has a certain digit in a certain position eg: number=45687 1 number=4 2..

Answer / vaibhav

#include<stdio.h>
#include<conio.h>
void main()
{
int n,t,i,cnt=1;
clrscr();
printf("\nEnter The No.");
scanf("%d",&n);
while(n%10!=0)
{
n=n%10;
t=n/10;
printf("\n %d number= %d",cnt,t);
cnt++;
}
getch();
}

Is This Answer Correct ?    2 Yes 2 No

Print all numbers which has a certain digit in a certain position eg: number=45687 1 number=4 2..

Answer / eranna

#include<stdio.h>
#include<conio.h>
void main()
{
int n,t,cnt=1;
clrscr();
printf("\nEnter The No.");
scanf("%d",&n);
while(n%10!=0)
{
t=n%10;
n=n/10;
printf("\n %d number= %d",cnt,t);
cnt++;
}
getch();

}

Is This Answer Correct ?    0 Yes 0 No

Print all numbers which has a certain digit in a certain position eg: number=45687 1 number=4 2..

Answer / 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

Print all numbers which has a certain digit in a certain position eg: number=45687 1 number=4 2..

Answer / vignesh1988i

sorry ... i could not understand ur question
properly....... can you post it again.... if
possible!!!!!!!!!!!!please

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More C Interview Questions

Write a c program to read a positive number and display it in words.? ex: 123=one two three help me....

2 Answers  


define string ?

0 Answers  


application attempts to perform an operation?

0 Answers  


what is the meaning of 'c' language

3 Answers  


input any 4 digit number and find the difference of all the digits?

3 Answers   Google,






Write a programe print the sum of series 0,1,2,.....10

7 Answers  


input may any number except 1,output will always 1.. conditions only one variable should be declare,don't use operators,expressions,array,structure

4 Answers   IBM,


Why preprocessor should come before source code?

2 Answers  


How can I rethow can I return a sequence of random numbers which dont repeat at all?

0 Answers  


what are the uses of structure?

7 Answers   HCL,


how do we remove the printed character in printf statement and write next it it

1 Answers  


What's the right way to use errno?

0 Answers  


Categories