/*Program to find Armstrong number between 1 to N*/
int main() {
int n = 0, remainder, sum = 0, i = 0, noDigits = 0, isArm = 0;
char ch[60] = {0};
printf("Find the Arm Strong Numbers between 1 to N");
scanf("%d", &n);
for(i = 1; i<n; i++)
{
isArm = i;
itoa(isArm, ch, 10);
noDigits = strlen(ch);
while(isArm)
{
remainder = isArm%10;
isArm=isArm/10;
sum= sum+pow(remainder, noDigits);
}
if(sum == i)
printf("\nArm Strong Nos are %d\n", i);
sum = noDigits = 0;
}
}
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.
#include
PRINT 2,3,5,7,11,13,17,19,23,29,31,37
find even number in array
you do this 10 print "0112358132134" use the whole of the thing
You can use int i; for (i = 10; i <= 50; i += 2) {//print i} as a program to print even numbers between 10 and 50.
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.
Write a c program to print the 100 to 1 nos
for (int i = 2; i < 10; i ++) printf("%d\n", i); You did say even and odd numbers between 1 and 10. That's allnumbers between 1 and 10.
how do we use loops in c plus plus programing and what are basic differences between do,for and while loop
#include
In GW-BASIC, you can print even numbers from 1 to 100 using a simple loop. Here’s a sample code: FOR i = 1 TO 100 IF i MOD 2 = 0 THEN PRINT i NEXT i This program iterates through numbers 1 to 100 and prints each number if it is even (i.e., divisible by 2).
PRINT 2,3,5,7,11,13,17,19,23,29,31,37
To write code for finding Armstrong numbers between 1 and 500 using socket programming, you would first create a server that listens for client connections. Upon receiving a request, the server would compute Armstrong numbers in that range by checking if the sum of the cubes of their digits equals the number itself. The server then sends the list of Armstrong numbers back to the client. The client can be a simple script that connects to the server and displays the received numbers. Here's a basic outline: Set up a server socket to listen for connections. Upon connection, calculate Armstrong numbers using a loop and send the result back. On the client side, connect to the server and print the received Armstrong numbers.
Oh, what a lovely request! In FoxPro, you can create a program to print all prime numbers from 1 to 100 by using a loop to check each number for divisibility only by 1 and itself. If it meets this criteria, you can print it out on the screen. Remember, every number is unique and special, just like a happy little tree in a vast forest.
Install your phone software program and download the list to your PC then print. Your phone program can be downloaded from your phone maker web site if it did not come with your phone package.
Try the triangle program on a search engine. Replace numbers with stars and that should do the trick