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
What is an lvalue in c?
What is && in c programming?
How are 16- and 32-bit numbers stored?
What is a null pointer assignment error? What are bus errors, memory faults, and core dumps?
What is else if ladder?
write a program that types this pattern: 12345678987654321 12345678 87654321 1234567 7654321 123456 654321 12345 54321 1234 4321 123 321 12 21 1 1
There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?
Hello. How to write a C program to check and display president party like if i type in the console "biden" and hit enter the output shoud be : "biden is democrat" and if i type "trump" and hit enter the output shoud be: "trump is republican"
Is c is a low level language?
please explain every phase in the "SDLC" in the dotnet.
What are types of structure?
Explain can static variables be declared in a header file?
What is storage class?
What is variable in c example?
What are the different types of control structures in programming?