🔒 Closed C prog help me please.

Status
Not open for further replies.

Manager Ken

Established
mga sir pde po ba paki explain ung mula sa linyang "for" hanggang dun sa i++ salamat po


#include<stdio.h>

int main()
{
int setofprimenumbers = 30, i = 2, count, c;

printf("First %d Prime numbers are : ", setofprimenumbers);

for ( count = 2 ; count <= setofprimenumbers;)
{
for ( c = 2 ; c <= i - 1 ; c++ )
{
if ( i%c == 0 )
break;
}
if ( c == i )
{
printf("%d ",i);
count++;
}
i++;
}

return 0;
}
 
Status
Not open for further replies.

About this Thread

  • 0
    Replies
  • 516
    Views
  • 1
    Participants
Last reply from:
Manager Ken

Trending Topics

Online now

Members online
404
Guests online
1,280
Total visitors
1,684

Forum statistics

Threads
2,274,140
Posts
28,953,851
Members
1,235,099
Latest member
hiro1985
Back
Top