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 |
Is c is a middle level language?
Explain about the constants which help in debugging?
Write a C program to check a number even or odd, without using any relational, arithmetic operator and any loops.
Why cant I open a file by its explicit path?
Is boolean a datatype in c?
how to create c progarm without void main()?
44.what is the difference between strcpy() and memcpy() function? 45.what is output of the following statetment? 46.Printf(“%x”, -1<<4); ? 47.will the program compile? int i; scanf(“%d”,i); printf(“%d”,i); 48.write a string copy function routine? 49.swap two integer variables without using a third temporary variable? 50.how do you redirect stdout value from a program to a file? 51.write a program that finds the factorial of a number using recursion?
consagous technology placement paper
1 1 1 1 2 1 1 3 3 1 1 4 6 4 1
Explain what does the format %10.2 mean when included in a printf statement?
Why is C called a middle-level language?
Write a program to show the change in position of a cursor using c