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


Please Help Members By Posting Answers For Below Questions

What is LINKED LIST? How can you access the last element in a linked list?

633


How can I convert a number to a string?

608


What is the difference between constant pointer and constant variable?

748


Does c have class?

613


Sir,please help me out with the code of this question. Write an interactive C program that will encode or decode multiple lines of text. Store the encoded text within a data file, so that it can be retrieved and decoded at any time. The program should include the following features: (a) Enter text from the keyboard, encode the text and store the encoded text in a data file. (b) Retrieve the encoded text and display it in its encoded form. (c) Retrieve the encoded text, decode it and then display the decoded text. (d) End the computation. Test the program using several lines of text of your choice.

1768






How can I find out if there are characters available for reading?

647


please help me..... please codes and flowchart plz turbo c lang po yan.....please asap response... 3. Make an astrology program. The user types in his or her birthday (month, day, and year as integer), and the program responds with the user’s zodiac sign, horoscope, and other information related to it. If the user’s birth year falls into a leap year, your program should display an appropriate message for it. NOTES: Conditional Statements: it should be with graphics

2860


How would you rename a function in C?

622


What is the difference between null pointer and wild pointer?

640


What is wrong in this statement? scanf(“%d”,whatnumber);

728


Can you please explain the difference between exit() and _exit() function?

594


What is the use of function overloading in C?

679


How would you obtain the current time and difference between two times?

730


What does %p mean?

595


Why do we need a structure?

590