write a program to display reverse of a number using for
loop?
Answer Posted / hema
int main()
{
int a = 234;
printf("\n");
while( a != 0)
{
printf("%d",a%10);
a /= 10;
}
return 0;
}
______________________________________________________
use below program if you want to store value in another
variable
______________________________________________________
int main()
{
int a = 234;
int b = 0;
printf("\n");
while( a != 0 )
{
b = b *10 + (a%/10);
a /= 10;
}
printf("\n values in revers order= %d \n",b);
return 0;
}
Is This Answer Correct ? | 22 Yes | 11 No |
Post New Answer View All Answers
where are auto variables stored? What are the characteristics of an auto variable?
What are all different types of pointers in c?
By using C language input a date into it and if it is right?
Stimulate calculator using Switch-case-default statement for two numbers
#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }
How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?
What is sorting in c plus plus?
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.
What are directives in c?
please can any one suggest me best useful video tutorials on c i am science graduate.please help me.u can email me to sas29@in.com
Why is a semicolon (;) put at the end of every program statement?
Which node is more powerful and can handle local information processing or graphics processing?
What is f'n in math?
What is the purpose of clrscr () printf () and getch ()?
Explain pointers in c programming?