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
What is static function in c?
How can a number be converted to a string?
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
If jack lies on Mon, Tue Wed and jill lies on Thursday, Friday and Saturday. If both together tell they lied yesterday. So c the given options and then c cos in the given dates one will be saying the truth and one will be lying. I got Thursday as option because jack is saying the truth he lied yest but jill is lying again as he lies on that day.
What is d scanf?
we need to calculating INCOME TAX for the person. The INCOME TAX is as follows:- First $10000/- of income : 4% tax Next $10000/- of income : 8% tax Next $10000/- of income : 11.5% tax above $10, 00,00/- : 15% tax What is the Solution of this Question ?
What is volatile variable in c with example?
Place the #include statement must be written in the program?
What are the 5 types of organizational structures?
Write a program to swap two numbers without using the third variable?
How can you find out how much memory is available?
Does c have an equivalent to pascals with statement?
What is register variable in c language?
Explain can static variables be declared in a header file?
what are the 10 different models of writing an addition program in C language?