If input is 123 then how to print 100 and 20 and 3 seperately?
Answers were Sorted based on User's Feedback
Answer / letskools
#include<stdio.h>
#include<conio.h>
void main()
{
int a[5];
int i, j,rem,k=0,x=1;
int num;
printf("enter any number");
scanf("%d",&num);
while(num>0)
{
rem = num % 10;
a[k] = rem * x;
x *= 10;
k++;
num /= 10;
}
for (i = k-1; i >= 0; i--)
{
printf("%d\n"a[i]);
}
getch();
}
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / charusheela
#include<stdio.h>
#include<conio.h>
void main(){
int num=123,r,i=1;
clrscr();
while(num)
{
r=num%10;
printf("%d\n",r*i);
i*=10;
num/=10;
}
getch();
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / dhruv sharma rkdf
#include<stdio.h>
#include<conio.h>
void main(){
int n,temp,i=1;
clrscr();
printf("enter number:");
scanf("%d",&n);
for(;n>0;n=n/10){
temp=(n%10)*i;
i*=10;
printf("%d\n",temp)
}
getch();
}
| Is This Answer Correct ? | 1 Yes | 0 No |
to find out the reverse digit of a given number
6 Answers Infosys, Microsoft, TCS, Wipro,
Can we add pointers together?
Magic square
Describe for loop and write a c program to sum the series X + x2/2! + x3 /3! + …….. up to fifteen terms.
What is the difference between null pointer and the void pointer?
how to find out the reverse number of a digit if it is input through the keyboard?
write a c programme for add of two numbers with out use of arthematic operators
Explain what is the purpose of "extern" keyword in a function declaration?
How pointer is different from array?
what is computer engg
write a program to check whether a given integer is a strong number or not? [Hint: 145=1!+4!+5! =1+24+120 =145]
How many types of functions are there in c?