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.
Chat with our AI personalities
# include<stdio.h> void main() { int i = 1; while(i<11) { if(i%2==1) { printf("\n%d",i); } i++; } }
Add the numbers into one variable as you read them in. But if you prefer, you can read the numbers into an array and then use a loop to add the numbers together.
This would require some computer knowledge. It can make it easier to find out the prime numbers without figuring it out in your head.
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.
N = x If y < N then N = Y If z < N then N = z Print N