Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

What are errors in this code? #include <stdio.h> #include <string.h> int main( )

ID: 2084337 • Letter: W

Question

What are errors in this code?


#include <stdio.h>
#include <string.h>

int main( ) {

//////////////////////////////////////////////////////////////////////////
////////////// Part A. //////////////////

int g(void)
{
printf("%s", Inside function g n " );
int h(void)
{
printf(" % s ", Inside function h n ");
}
}

printf("Part A: ");
g();
printf(" ");

//////////////////////////////////////////////////////////////////////////
////////////// Part B. //////////////////


int sum( int x, int y )
{
int result;
result = x + y;
}

printf("Part B: % d ", sum(5,3));


//////////////////////////////////////////////////////////////////////////
////////////// Part C. //////////////////


void f( float a );
{
float a;
printf( "%f", a );
}


printf("Part C: % 1f ", f(1.1));

//////////////////////////////////////////////////////////////////////////
////////////// Part D. //////////////////


#include <stdio.h>
#include <string.h>

int main( ) {

int sum( int n )
{
if ( 0 == n )
{
return 0;   
}   
else
{   
n + sum( n - 1 );
}
}

printf("Part D: % d ", sum(3));
return 0;
}


//////////////////////////////////////////////////////////////////////////
////////////// Part E. //////////////////


void product( void )
{
int a, b, c, result;
printf( "%s", "Enter three integers: " )
scanf( "%d%d%d", &a, &b, &c );
result = a * b * c;
printf( "Result is: %d", result );
return result;
}

printf( "Part E: %d", product ());


return 0;
}

Explanation / Answer

The program you have provided is a C language code.

here are some important points:

Here I have modified the code for you which contains no errors.

Code::::

#include <stdio.h>
#include <string.h>

//////////////////////////////////////////////////////////////////////////
////////////// Part A. //////////////////
int h(void)
{
printf("Inside function h ");
}
int g(void)
{
printf("Inside function g " );
h();
  
}

//////////////////////////////////////////////////////////////////////////
////////////// Part B. //////////////////

int sumx( int x, int y )
{
int result;
result = x + y;
}

//////////////////////////////////////////////////////////////////////////
////////////// Part C. //////////////////

float f( float a )
{
printf( "%f", a );
}
//////////////////////////////////////////////////////////////////////////
////////////// Part E. //////////////////

int product( void )
{
int a, b, c, result;
printf( " Enter three integers: " );
scanf( "%d %d %d", &a, &b, &c );
result = a * b * c;
printf( "Result is: %d", result );
return result;
}

//////////////////////////////////////////////////////////////////////////
////////////// Part D. //////////////////


int main( ) {
int sum( int n )
{
if ( 0 == n )
{
return 0;   
}   
else
{   
n = n + sum( n - 1 );
}
}
printf("Part A: ");
g();
printf(" ");
printf("Part B: % d ", sumx(5,3));
printf("Part C: % 1f ", f(1.1));
printf("Part D: % d ", sum(3));
printf( "Part E: %d", product ());
return 0;
}

please go through the code and comment if any further assistance required.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote