Write a program that get the input of two integers n and m(n < m). Find out all prime numbers between n and m (not include n and m), then display them on the screen.
寫一個程式 輸入兩個整數n和m (n < m),找出所有n到m之間的質數(不包含n和m)。
Example input 1
1 10
Example output 1
2 3 5 7
Example input 2
10 20
Example output 2
11 13 17 19
Hidden content!#include<stdio.h>int main(){ int a,b,j,i,c=0; * * * * * ** ** * * * * ** * * * * ** ** * * * * * * * * * * * * *** * * * * ** ** * **** * * * * * ** * ** **** * * * ** ** * * * * *** * * *** * ** * ** **** * * *** ***** * * * * * * * * * ** * * * ******* ** * * * * ****** * * * * * * ** * *** ** * * *** * ** ** ** *** ** *** * * * * * * ** * * ** * * *** * * * * * * * * ** * * * * * * * * * ** ** ** *** * * * *** * * ** * * *** * * * * ** * * * * * * ** * * * * ** * * ** * ** ****** * * * * * * ** ** ** *** * * * * ** * * * * * * *** * * * * * *** *** * *** * * * * * ** * } else{* * * * * ** * * * ** * ** * * * * * * ** * * * ** %d",j);}** * ** ** * * * * * * ** 0;}
Hidden content!#include<stdio.h>int main(){ int a,b,c,d,e,i,o; **** * * *** * *** ** * ** * %d",&a,&b);