answersLogoWhite

0


Best Answer

#include <stdio.h>

int main()

{

int number, temp;

printf("enter the number");

scanf("%d",&number);

printf("\n reverse of %d",number);

while(number>0)

{

temp=temp*10+number%10;

number=number/10;

}

printf(" is %d",temp);

}

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: C code on Reversing integer array elements using temporary variable?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How can you make a array with the number 16?

If you mean how do you create an array with 16 elements, there are two ways: int a[16]; /* fixed size array of 16 integer elements */ int* b = malloc(16*sizeof(int)); /* variable length array with (initially) 16 integer elements */ Remember that variable length arrays allocated on the heap must be released as soon as they are no longer required: free (b); b=NULL;


How you can modify an integer variable value in a function?

with an assignment: variable = value variable += value variable /= -3; ...


Can you declare printf for integer variable?

printf is declared in stdio.hFormat specifier for an integer value is %d.


If structure is arraythen an individual array element can be accessed by writing a variable?

A structure is not an array. Individual array elements are accessed through a number, called a "subscript". This subscript can be a constant, or a variable, or any expression that can be evaluated to give an integer.A structure is not an array. Individual array elements are accessed through a number, called a "subscript". This subscript can be a constant, or a variable, or any expression that can be evaluated to give an integer.A structure is not an array. Individual array elements are accessed through a number, called a "subscript". This subscript can be a constant, or a variable, or any expression that can be evaluated to give an integer.A structure is not an array. Individual array elements are accessed through a number, called a "subscript". This subscript can be a constant, or a variable, or any expression that can be evaluated to give an integer.


How do you turn a positive integer into a negative integer in programming?

Store the absolute value of the desired integer in a variable. Multiply the absolute value by two. Substract the new integer by the old integer.

Related questions

What is the code required to convert an integer variable to a string variable in Java?

There are several different methods to convert an integer variable to a string variable in Java. For example, one can use the following code to convert an integer variable to a string variable: Integer.toString(number)


(variable) = 34?

Integer


How can you make a array with the number 16?

If you mean how do you create an array with 16 elements, there are two ways: int a[16]; /* fixed size array of 16 integer elements */ int* b = malloc(16*sizeof(int)); /* variable length array with (initially) 16 integer elements */ Remember that variable length arrays allocated on the heap must be released as soon as they are no longer required: free (b); b=NULL;


How you can modify an integer variable value in a function?

with an assignment: variable = value variable += value variable /= -3; ...


What are variable raised to whole number powers?

They are the integer powers of that variable.


Is the value 3 a string variable?

No, it is an integer. You can save an integer value to a string variable but, in this case the value is explicitly stated to be 3.


How do you declare an integer?

datatype variable name;


If a variable has possible values -2 6 and 17 then this variable is?

If a variable has possible values -2 6 and 17 then this variable is an Integer.


What is difference between an integer variable and floting point variable?

The set of the possible values.


Can you declare printf for integer variable?

printf is declared in stdio.hFormat specifier for an integer value is %d.


If structure is arraythen an individual array element can be accessed by writing a variable?

A structure is not an array. Individual array elements are accessed through a number, called a "subscript". This subscript can be a constant, or a variable, or any expression that can be evaluated to give an integer.A structure is not an array. Individual array elements are accessed through a number, called a "subscript". This subscript can be a constant, or a variable, or any expression that can be evaluated to give an integer.A structure is not an array. Individual array elements are accessed through a number, called a "subscript". This subscript can be a constant, or a variable, or any expression that can be evaluated to give an integer.A structure is not an array. Individual array elements are accessed through a number, called a "subscript". This subscript can be a constant, or a variable, or any expression that can be evaluated to give an integer.


How do you turn a positive integer into a negative integer in programming?

Store the absolute value of the desired integer in a variable. Multiply the absolute value by two. Substract the new integer by the old integer.