Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

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..

#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..

#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..

#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..

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

 Is This Answer Correct ? 0 Yes 1 No

More C Interview Questions

What is the value of y in the following code? x=7;y=0; if(x=6) y=7; else y=1;

What is putchar() function?

What is difference between array and pointer in c?

my name is nani i completed my b-tech in hyd now i want go for interveiw but i dont know the process of software field interveiws plz help me anyone how many rouds there n what rounds plz plz plz help me n where i can get these details

main() { int a[10]; printf("%d",*a+1-*a+3); }

What is use of integral promotions in c?

Should a function contain a return statement if it does not return a value?

Explain how can I prevent another program from modifying part of a file that I am modifying?

Why & is used in scanf in c?

how should functions be apportioned among source files?

What is the purpose of clrscr () printf () and getch ()?

print out put like this form 1 2 3 4 5 6 3 5 7 9 11 8 12 16 20

Categories