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

WAP &#8211; represent a char in binary format

4 Answers   Motorola, Wipro,


How many bytes is a struct in c?

0 Answers  


5) Write a program that takes a 3 digit number n and finds out whether the number 2^n + 1 is prime, or if it is not prime find out its factors.without using big int and exponential function

1 Answers   TCS,


Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?

0 Answers  


say the following declaration is correct nr not. int b=a,n=0;

4 Answers   Wipro,






main() { int a = 65; printf(“%d %o %x”,a,a,a); } Output 65 101 41 Please explain me.How it is coming like that?

3 Answers   Excel,


What are qualifiers and modifiers c?

0 Answers  


write a program in c language that uses function to locate and return the smallest and largest integers in an array,number and their position in the array. it should also find and return the range of the numbers , that is , the difference between the largest number and the smallest.

1 Answers  


What is the difference between class and object in c?

0 Answers  


show how link list can be used to repersent the following polynomial i) 5x+2

0 Answers   CBSE,


C passes By value or By reference?

5 Answers   Geometric Software, Infosys,


What is the value of a[3] if integer a[] = {5,4,3,2,1}?

0 Answers  


Categories