If input is 123 then how to print 100 and 20 and 3 seperately?
Answer Posted / 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 |
Post New Answer View All Answers
If null and 0 are equivalent as null pointer constants, which should I use?
Explain the difference between malloc() and calloc() function?
if p is a string contained in a string?
Give basis knowledge of web designing ...
If errno contains a nonzero number, is there an error?
write a program in c language to print your bio-data on the screen by using functions.
How can I convert a number to a string?
Write a code to determine the total number of stops an elevator would take to serve N number of people.
What are the rules for identifiers in c?
What are the similarities between c and c++?
What is a header file?
explain what are pointers?
i want to know the procedure of qualcomm for getting a job through offcampus
Explain low-order bytes.
What are the types of data types and explain?