If input is 123 then how to print 100 and 20 and 3 seperately?
Answer Posted / 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 |
Post New Answer View All Answers
Explain two-dimensional array.
What is structure packing in c?
Why do we need arrays in c?
What is a newline escape sequence?
Write program to remove duplicate in an array?
What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?
What is the difference between %d and %i?
What are header files in c programming?
Is c call by value?
Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.
Explain how can I pad a string to a known length?
List the difference between a "copy constructor" and a "assignment operator"?
Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.
write a c program to find the sum of five entered numbers using an array named number
What is a lvalue