The function 'countPrimes' is given below to find the count of prime numbers enclosed within double quotes in an array with 12. Which of the following is the missing code line? int countPrimes( char *a[]) { int i,j,num,nump 0,flag; for (j = 0; j< 12; ++j) { for(i=2; i

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Array Concepts
Section: Chapter Questions
Problem 9RQ
icon
Related questions
Question
100%
The function 'countPrimes' is given below to find the count of prime numbers enclosed within
double quotes in an array with 12. Which of the following is the missing code line?
int countPrimes( char *a[]) { int i,j,num,nump 0,flag; for (j = 0; j< 12; ++j) {
for(i=2; i<num/2; i++) { if(num%i ==0) {flag
=1;break;} } if(flag%=D%3D0) nump++; } return nump;}
a. num3strtod(a[j],&j);if(num<2){flag313;} else{flag=D0;}
b. num=atoi(a[i]);if(num<2){flag3D03;} else{flag=1;}
c. num=atoi(a[j]);if(num<2){flag=D1;} else{flag-D0;}
d. num=strtod(a[G],&i);if(num<2){flag=0;} else{flag=13;}
e. num=atoi(a[j]);if(num<2){flag3D0;} else(flag=1;}
Transcribed Image Text:The function 'countPrimes' is given below to find the count of prime numbers enclosed within double quotes in an array with 12. Which of the following is the missing code line? int countPrimes( char *a[]) { int i,j,num,nump 0,flag; for (j = 0; j< 12; ++j) { for(i=2; i<num/2; i++) { if(num%i ==0) {flag =1;break;} } if(flag%=D%3D0) nump++; } return nump;} a. num3strtod(a[j],&j);if(num<2){flag313;} else{flag=D0;} b. num=atoi(a[i]);if(num<2){flag3D03;} else{flag=1;} c. num=atoi(a[j]);if(num<2){flag=D1;} else{flag-D0;} d. num=strtod(a[G],&i);if(num<2){flag=0;} else{flag=13;} e. num=atoi(a[j]);if(num<2){flag3D0;} else(flag=1;}
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT