First, create a for loop from a,1 to 50. Inside of that create another for loop b,2 to a-1. If a/b=int(a/b) then you know it is not prime
PRINT 2,3,5,7,11,13,17,19,23,29,31,37
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.
This would require some computer knowledge. It can make it easier to find out the prime numbers without figuring it out in your head.
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.
/*the program to print prime no from 1 to 300*/ #include<stdio.h> #include<conio.h> void main() { int i,j; clrscr(); printf("The prime numbers from 1 to 300 are\n"); for(j=2;j<=300;j++) { for(i=2;i<=j/2;i++) if(j%i==0) break; if(i>j/2) { printf("%d ",j); } } }
#include
This is a homework question and does not deserve an answer because you will learn nothing other than being lazy.
Use a counted loop in the closed range [1:100]. If the count is in the closed range [40:50], print the number. For all other numbers outwith this range, only print the number if it is prime.
The prime numbers before 100 are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, and 97. To print these prime numbers, simply cut and paste this list into your computer word processor and print it like any other document.
Try the triangle program on a search engine. Replace numbers with stars and that should do the trick
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.