76 311
Assignments Done
Successfully Done
In May 2019

Answer to Question #6015 in C++ for Amedeus Simon

Question #6015
write a program that reads a list of any five numbers and counts the number of threes and sevens in the data(this is C++ question)
Expert's answer
#include <iostream>
using namespace std;

char str[50];
int i,k, NumOfThrees=0, NumOfSevens=0;

void count(){
cout<<"Enter a number: ";
for (i=0;i<=strlen(str);i++){
& if (str[i]=='3') NumOfThrees++;
& if (str[i]=='7') NumOfSevens++;

void main(){

for (k=1;k<=5;k++) count();

cout<<"The number of threes is "<<NumOfThrees<<"\r\n";
cout<<"The number of sevens is "<<NumOfSevens<<"\r\n";

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions