how to remove the last comma between 2 prime number

    #include <iostream>
using namespace std;
int main(){
    int a=0 , b=0;
    for(int i = a+1;i < b;i++){
        int counter = 0;
        for(int j = 2;j <= i / 2;j++){
            if(i % j == 0){
        if(counter == 0 && i!= 1){

    return 0;

hi guys how to remove the last comma from this code? i think we have to add 1 if statement but i dont know what should i do... please help me thanks

Read more here:

Content Attribution

This content was originally published by user16497151 at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: