#include <stdio.h>
#include <math.h>
#include <string.h>

int main(void){
	int m, n;
	int y=0;
	int t;
	scanf("%d", &m);
	scanf("%d", &n);
	
	for(int i=m; i<=n; i++)
	{
	    for(int j=2; j<i; j++)
	    {
	        if(i%j==0)
	        {
	            j=i;
	        }
            else
            {
                t=i;
	            y=y+i;
            }
	    }
	}
	printf("%d \n %d",y, t);
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: