Inversing of a given Number. suppose we gave input 123456 then the output of the program will be 654321./*mycfiles.wordpress.com
C program to print inverse of a given number*/
#include
#include
void main()
{
long int n,rn=0,d=0;
clrscr();
printf("Enter the number\n\n");
scanf("%ld",&n);
while(n>0)
{
d=n%10;
rn=rn*10+d;
n=n/10;
}
printf("%ld",rn);
getch();
}
One way to do this is to convert the number to a String, then use the corresponding String method to find out the length of the String.
see pages 43-49 in Principles of Program design by M. A. Jackson, 1975
wap to print all the arnstrong no. between 100&1000
Q.1 Write a program to print first ten odd natural numbers. Q.2 Write a program to input a number. Print their table. Q.3 Write a function to print a factorial value.
i want to write a simple without using pointer or array c program which will print greatest number when i give 20 number .........How far have you gotten so far?
There are two types of inverse numbers in this context: additive and multiplicative. An additive inverse number is a number that's had its sign flipped: positive becomes negative, and negative becomes positive. The PHP code for this would be: $result=-$number; A multiplicative inverse number is a number that's been divided into 1. So 5 becomes 1/5, and 1/5 becomes 1/1/5, or 5. The PHP code for this would be: $result=1/$number;
first sort the ten numbers in descending order and print the first number. That will be the largest no
One way to do this is to convert the number to a String, then use the corresponding String method to find out the length of the String.
10 cls 20 input"enter word";word$ 30 print word$ 40 print len(word$) 50 end this program is for GW BASIC for other BASIC's the line numbers are optional.
bghjg
see pages 43-49 in Principles of Program design by M. A. Jackson, 1975
Prime numbers are numbers that are only divisible by themselves and the number 1. You can write a program to print all prime numbers from 1 to 100 in FoxPro.
wap to print all the arnstrong no. between 100&1000
Q.1 Write a program to print first ten odd natural numbers. Q.2 Write a program to input a number. Print their table. Q.3 Write a function to print a factorial value.
/*We can calculate this with a lot of methods I'll explain only one of them */ *str = "abcd"; // this is a input string printf("%d", strlen(str));
Yes, it is possible to do that.
There is no such thing as 'the greatest number'. Here is a program in unix to prove it: echo 'for (i=1; i>=0; i= i*2) print i,"\n";' | bc if you want to actually see the output use it this way: echo 'for (i=1; i>=0; i= i*2) print i,"\n";' | bc | less -S