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

Can a pointer be static?

0 Answers  


whitch value return void main?

11 Answers  


What is a macro in c preprocessor?

0 Answers  


What is the difference between a function and a method in c?

0 Answers  


define switch statement?

6 Answers   CTS,






c pgm count no of lines , blanks, tabs in a para(File concept)

2 Answers  


How can you draw circles in C?

0 Answers   Accenture,


plz answer..... a program that reads non-negative integer and computes and prints its factorial

2 Answers  


What is a good way to implement complex numbers in c?

0 Answers  


how to write a program which adds two numbers without using semicolon in c

2 Answers  


WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?

0 Answers   HP,


what is diognisis?

1 Answers  


Categories