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 are disadvantages of C language.
Why C language is a procedural language?
What is a macro in c preprocessor?
What is the return type of sizeof?
What does the && operator do in a program code?
What are near, far and huge pointers?
What are the advantages and disadvantages of c language?
Implement bit Array in C.
Explain what is the difference between text files and binary files?
Why can’t constant values be used to define an array’s initial size?
In C language what is a 'dangling pointer'?
How macro execution is faster than function ?
When a c file is executed there are many files that are automatically opened what are they files?
Hai,I have done with my bachelor of commerce and planing to ms,please suggest me how to convince vo for shifting from commerce to computers. Visa on 8 DEC 2014 Npu university
Is null valid for pointers to functions?