Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Below are the C and Java codes for the same programme. Compare the results of both with the reasons. #include #include int x = 5

Below are the C and Java codes for the same programme. Compare the results of both with the reasons.
#include
#include
int x =5;
int test (int y)
{
x = y;
return 6;
}
int main()
{
x = x + test (3);
printf("%d",x);
return 0;
}
import java.util.*;
import java.lang.*;
import java.io.*;
class Ideone
{
public static int x =5;
public static int test(int y)
{
x = y;
return 6;
}
public static void main(String[] args) throws java.lang.Exception
{
x = x + test (3);
System.out.println(x);
}
}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions