#include <stdio.h>
main (int argc, char **argv)
{
long inx, num, n, ns, r1, r2;
num = atol(argv[1]);
printf("num=%ld\n", num);
for (inx = 1; inx < num; inx++)
{
n = inx;
ns = n*n;
while (n > 0)
{
r1 = n%10;
r2 = ns%10;
if (r1 != r2) break;
n = n/10;
ns = ns/10;
}
if (n == 0)
{
printf("%ld is automorphic\n", inx);
}
}
}
how to write a program that counts automorphic number from 1 to 999
its supposed to have an asterisk there before the 's but it wouldnt print it
C++ is related to C, the language from which it is derived.
void print_evens (size_t n) {for (size_t x=0; x<=n; x+=2) { std::cout << x << std::endl; } }
Yes!Visual Java plus plus and Java Builder is different from the Java language?
how to write a program that counts automorphic number from 1 to 999
console.wrikerle("""");
bghjg
its supposed to have an asterisk there before the 's but it wouldnt print it
i want plus 1 blue print for all subjects
printf();
Write a function that print a triangle of stars.
C++ has no print option. The print option in your IDE allows you to print your C++ source code, thus giving you a "hard" copy of your code.
you++ will return the current value of you and increment it. ++you will increment it and then return the new value of you. So, for example: int you = 0; cout << you++; // this will print 0 cout << you; // this will print 1 int you = 0; cout << ++you; // this will print 1 cout << you; // this will also print 1
No.
A multiplication table requires more than two numbers so I'll assume you really meant to say print the product of the two numbers. #include <iostream.h> int main{ int x, y; cout << "Please enter the 1st number: "; cin >> x; cout << "Please enter the 2nd number: "; cin >> y; cout << "The product is: " << x * y; return 0; };
Plus - programming language - was created in 1976.