What will be the output of the program given below? #include int main () { int a = -10, b 20; if(a > 0 & & b <0) %3D %3D a++; else if(a < 0 && b < 0) a--; else if(a < 0 && b > 0) b--; else b--; printf("%d\n", a + b); return 0; Output:
Q: include int main() { int M; printf("Enter the number of chairs you want to…
A: As your question , i run the code i got two issue in the given code:…
Q: Û docs.google.com. using namespace std; int main() { int x = 3; 9:18 U tx
A: The correct option for this will be (c) Run time error.
Q: #include #include main() { int m, sum = 0, counter = 0; int first = 2147483647, second = 2147483647,…
A: C++ Code with some corrections: #include<stdio.h> #include<stdlib.h> using namespace…
Q: The general form of (Compound if) is: If (condition); {statmenet1; } else {statmenet1; } * true…
A: A variable holds garbage value when not initialised. C plus plus is case sensitive programming…
Q: #include #include int LineFunc(void); int main() { int a, b; printf("Enter a :"); scanf("%d", &a);…
A: In code draws a line which is in the form of y = mx+c The input to the code is a and b where a = m…
Q: Help me create a FLOWCHART for this #include int main() { float numbers[5]; int j, pctr=0,…
A: Given program is about to find the number of positive numbers and negative numbers. Algorithm:…
Q: Create a program that will ask user to input two numbers and choose from the four mathematical…
A: Program Explanation: Declare the required header file Define the main function Declare variables…
Q: run this code and show result #include #include int main() { char i; int y = 0; while(1) {…
A: Explanation of Code: This is a C program that waits for a key to be pressed. If a key is not…
Q: 2) What does this code output? int fun(int x, int y) { if (x == 0) return 13; x = x/23; y = y - 1;…
A: To do: Output of the given code
Q: Question R .Consider the program segment below : #include void guess (int,int); int main() {…
A: Start the program.Declare integer variables a, b, and c and initialize a with the value 100 and b…
Q: The type of error in the following program is #include void main() {int m,n; for(m=1;m<4;++m)…
A: Given the c++ program we have to find the type of error in the following Program is:
Q: #include #include double f(double x){ return x*x; } double reimannSums(double…
A: NOTE: - The program is working based on sample values. These values are: - COMMAND LINE ARGUMENT: -…
Q: #include int main() { } int a, b, c, i=0; for (c = 0; c < 7; c++) { } for(b = 0; b < c; b+) { }…
A: The above question is solved in step 2 :-
Q: #include int a=5; int main() { int x; x = ~a+a&a+a<<a; printf("%d",x); return 0; } Give output…
A:
Q: #include #include int LineFunc(void); int main() { int a, b; printf("Enter a :"); scanf("%d", &a);…
A: Edited code for the above C program #include <stdio.h> #include <stdlib.h> void…
Q: C programming. How would I get Somethings output to be Something2's input void Something(char *i){…
A: The problem is based on the basics of functions in C programming language.
Q: Block wise explain the program given below. #include int main() { float numbers[5]; int j,…
A: Given: Block wise explain the program given below. #include <stdio.h>int main() { float…
Q: #include int main() { float a =3e-1,b=2e-2; printf("a=%f b=%f",a,b); return 0; } note : what is e…
A: e work as scientific notation for example. Significand Exponent Scientic notation float/fixed…
Q: #include int main() { int x = 5866, y = 5455; int z = x; x = y; y = z;…
A: This question is asking for output of a c programming question.
Q: Consider the following C program. # include int main() { char s3; float s2; int s1; scanf("%d %f…
A: Explore and analyze the given options such as “5 H 1.2”, “H”, and “1.2” and check whether they are…
Q: Federal law requires that hourly employees be paid “time-and-a-half” for work in excess of 40 hours…
A: workingHours=float(input("Enter number of working hours: ")); #input working…
Q: Find error in program include void main() { int x = 10; int y = 15; printf("%d", (x, y)) }
A: The error is at line no. 4: In this line the semi-colon is missing at the end. Below is the correct…
Q: In c void f (int *p, int * const q) { p=q *p=3; *p=4; }
A: The pointer in C language is a variable which stores the address of another variable.
Q: u modify this code so k only prints even numbers
A: Program explanation: Here, nested for loop is used in the program. The outer loop iterates 2 times…
Q: #include #include int mutex=1,full=0,empty=1,x=0; main() { int n; void producer(); void…
A: Actually, producer consumer bash script code has given below:
Q: int a 5; int b = 6; int nain(void){ printf("d Xd \n", a, b); int a; printf("d Xd \n", a, b); return…
A: Given: The output of the first program was 5 6 0 6 this is because when first time the value of a…
Q: #include #include int LineFunc(void); int main() { int a, b; printf("Enter a :"); scanf("%d", &a);…
A: In this code, a line in the form of y = mx + c is drawn. Here, c is the intercept part, and m =…
Q: can you make a flow chart of this: #include int main(){ int num1, num2;…
A: #include <stdio.h> int main(){ int num1, num2; for(num1 = 1; num1 <= 10;…
Q: #include void main() { while (x < 5 && y<6){ X = X + 1; y = y + 2; cout << "X:"<< X << ""; cout <<…
A: In the given program no such file or directory error occurs.
Q: 1: 1. What is t bid main(){
A: Solution - In the given question, we have to tell the output of the given C code.
Q: can you code this in java #include int main() { float c, f; /* Input temperature in…
A: 1) Below is Equivalent JAVA program to convert temperature from Fahrenheit to Celsius It imports…
Q: What is the output of this C code? #include int main() { float f = 0.1; if (f == 0.1)…
A: Given, Code: #include <stdio.h> int main() { float f = 0.1; if (f == 0.1) printf("True");…
Q: Given that x = 0, what is the output of this code #include int main (void) { int x; printf…
A: GIVEN: Given that x = 0, what is the output of this code #include <stdio.h> int main (void)…
Step by step
Solved in 2 steps with 2 images
- int f(int x, int y); int a = 7; int b = 5; int main(void){ int c = f(a,b); int a = 9; int b = 8; printf("Sd\n", c); return e; int f(int x, int y) { a = x - y; b-x + y; return a + b; What integer does this program print to the console?what will be the output? #include int main () {int i = 3; i++; print ("%d", i); i--; print ("%d", i); return 0;} a. 34, b. 33, c. 44, d. 43Please help me with the below please post the program below into the bigger program. And please ensure that the big program works class Main { static int fT = 2, ST = 2, CT = 0; static int fN=3,sN=3,cN=0; static void number(int num) { if (num < 17) { return; } else { System.out.print(num + " "); // call function recursively number(num - 1); } } static void number1(int num) { if (num < 9) { return; } else { System.out.print(num + " "); // call function recursively number1(num - 2); } } static void number3(int num) { if (num > 18) { return; } else { System.out.print(num + " "); // call function recursively number3(num + 2); } } static void number4(int num) { if (num > 10) { return; } else { System.out.print(num + " "); // call function recursively number4(num + 1); } } static void number5(int…
- Examine the following code segment and consider what variable bindings will be visible at various points in the program under both STATIC and DYNAMIC scoping. 01 int h, i;0203 void B(int m) {04 int j, k;05 // what is visible HERE?06 ...07 }0809 void A(int j, int k) {10 float h = j + k;11 B(h);12 ...13 }1415 void main() {16 int i, j;17 18 A(h, i);19 B(h);20 ...21 }Language: javai cant use static void Main(string[] args) for this assignment for C# this is what I have to work with using System; using static System.Console; class GuessingGame { static void Main() { // Write your main here } } This problem relies on the generation of a random number. You can create a random number that is at least min but less than max using the following statements: Random ranNumberGenerator = new Random();int randomNumber;randomNumber = ranNumberGenerator.Next(min, max); Write a program named GuessingGame that generates a random number between 1 and 10. (In other words, in the example above, min is 1 and max is 11.) Ask a user to guess the random number, then display the random number and a message indicating whether the user’s guess was too high, too low, or correct.
- Solve in steps ( Introduction to Java )Explain this java codes private void put(int cell,int player) { int i=-1,j=-1;; switch(cell) { case 1:i=2;j=0;break; case 2:i=2;j=1;break; case 3:i=2;j=2;break; case 4:i=1;j=0;break; case 5:i=1;j=1;break; case 6:i=1;j=2;break; case 7:i=0;j=0;break; case 8:i=0;j=1;break; case 9:i=0;j=2;break; default:display(overridegrid);return; } char mark='x'; if(player==0) mark='o'; grid[i][j]=mark; display(grid); } private int startGame() { init(); display(grid); int status=playingid; while(status==playingid) { put(playerMove(),0); if(override==1) { System.out.println("O wins."); return playerid; } status=checkForWin(); if(status!=playingid) break; try{Thread.sleep(1000);}catch(Exception e){System.out.print(e.getMessage());} put(compMove(),1); status=checkForWin(); } return status; } private void init() { movesPlayer=""; override=0; marks=new int[8][6]; wins=new int[][] //new int[8][3]; weights=new int[]{3,2,3,2,4,2,3,2,3}; grid=new…C#: I wanted to do do an excerpt from a Dr.Seuss Book "oh the places youll go". Im stuck on how to include all of the requirements. my code so far: using System; class Program { static void Main() { string paragraph = “You have brains in your head. \You have feet in your shoes. \You can steer yourself any direction you choose. \You're on your own. \And you know what you know. /And YOU are the one who'll decide where to go...”\""; string upperCase = paragraph.ToUpper(); string replaced = upperCase.Replace(""); Console.WriteLine($"{replaced}\n- Dr.Seuss"); } }