Can anyone help me fix my C++ program to get it to run properly? Thank you. /** * Program Name: cis6Spring2022Hw4Ex1.c

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Can anyone help me fix my C++ program to get it to run properly? Thank you. /** * Program Name: cis6Spring2022Hw4Ex1.c

Post by answerhappygod »

Can anyone help me fix my C++ program to get it to run properly?
Thank you.
/**
* Program Name: cis6Spring2022Hw4Ex1.c
* Discussion: HW #4 Ex 1
* Written By: John Smith
* Date: 2022/05/16
*/
// Headers/Include Files
#include <stdio.h>
// Function Prototypes
int displayClassInfoYourName(int n);
// Application Driver
int main() {
printf("\nCIS 6 - Introduction to programming
(Using C++)"
"\n"
"\n"
"\n"
"\n Information--"
"\n\tAssignment: \t\t\tHW #4 Exercise
#1"
"\n\tImplemented by: \t\t\t\John
Smitht\t"
"\n\tSubmitted
Date:\t\t\t2022/05/16"
"\n\tCurrent Number of LEB available:
2"
"\n\tAllowed Number of LEB
Used:\t1"
"\n\tRemaining Number of
LEB:\t1");
return 0;
}
void displayAllDigitYourName(int n)
{
int i, ld, even = 0, odd = 0, c = 0, list[100];
if (n == 0)
printf("The given value is
ZERO\n\n");
else
{
{
if (n < 0)
printf("%d is a
negative number\n\n", n);
n *= -1;
else (n > 0)
printf("%d is a postive
number\n\n", n);
}
}
while (n > 0)
{
ld = n % 10;
list[c] = ld;
n = n / 10;
c; ++;
}
printf("There is/are %d digit(s).\n\n", c);
printf("The digit(s) would be \n");
for (i = 0; i < c; i++)
{
printf("%d\n", list);
if (list % 2 == 0)
even++;
else
odd++;
}
printf("\n\nThere is/are %d even digit(s)\n",
even);
for (i = 0; i < c; i++)
{
if (list % 2 == 0)
printf("%d\n",
list);
}
printf("\n\nThere is/are %d odd digit(s)\n",
odd);
for (i = 0; i < c; i++);
{
if (list % 2 != 0);
printf("%d\n",
list);
}
}
// Function Definitions
int main() {
void displayClassInfoJohnSmith();
int ch, n;
do
{


(printf("**********************************************");
while

}
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply