Debug the following given C statement and write its output. Also attach the screenshots of output and code. main() { int m,n; for(i 0; i << 5; i++) { printf("\t\t\t\t"); for(j 0; j << 5; j+++) printf("*"); printf("/n"); }
Q: 2. Refer to the statement below, #include void main(){ int ij: for(i=0;i<5;i++) { for(j=0;j<5;j++){…
A: I modify your code as per the output and provide the code ,output and their screenshot
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: void change( int a[]) , the compiler converts the parameter to: Select one: a. int *const a b. int…
A: The compiler changes void change(int a[]) silently to void change(int *const a) at the time of…
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: a. Add the following operation to the class stackType : void reverseStack(stackType &otherStack);…
A: Objective: A function would be added to the stackType class to copy elements from an existing stack…
Q: #include <stdio.h>int main(){int d;int s[20],i, j, p, lg=0,m,t=0;char c;printf("Enter number…
A: The function getch() defines under <conio.h> header file, include <conio.h> header file…
Q: int f(int &k) { k++; return k * 2; } int main() { int i = 1, j = -1; int a, b, c; a = f(i) + i/2; b…
A: The provided C++ code presents a concise illustration of function calls and variable assignments,…
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: #include int main() { int s = 8+ 2 / 2 + 10 * 8; printf("%d", s); return 0; } I need…
A: In this question a c programming code is given and it is asking for it's output.
Q: #include <stdio.h>int main(){int d;int s[20],i, r, p, lg=0,m;char c;printf("Enter number of…
A: Add the statement “i+1” in the print statement: printf("salesman %d ",i+1); Add another array to…
Q: #include int main() { int a[] = {5, 4, 3, 2}; int total = 0; for(int i = 0; i < 4; i++)…
A: Given question is based on c programming and is asking for the output of given code.
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: Given the variable initializations int a[5] = {0, 10, 20, 30, 40};int k = 3;int *p = a + 1;determine…
A: Note: There are multiple questions are given in one question. According to the rule, you will get…
Q: What is the output of the following C code: Code: #include #include void hack_fun (char p[]){ p=…
A: Find the output of the given C program.
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: In C++ Language: (Check password) Some websites impose certain rules for passwords. Suppose the…
A: Step-1) Defining a function for password validity asbool ValidPassword(const std::string&…
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: In C++ (Algebra: solve 2 × 2 linear equations) You can use Cramer’s rule to solve the following 2…
A: I give the code in C++ along with output and code screenshot
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: Change this code into a program that receives a number and prints its divisors.( C language)…
A: #include <stdio.h>int main() { unsigned guess; /* current guess for prime */ unsigned factor;…
Q: 1) Find the errors in the following codes: int Main() { } int { Hanging Indent #include ; int a =…
A: The above question is answered in step 2 :-
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: #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: Assume a, b, c and n are float variables, and d, e, fand m are integer variables, what is the result…
A: As I have read the guidelines I can provide answers to only 1 part of the questions in case of…
Q: #include //Function to calculate the factorial of a given positive integer int factorial(int n) {…
A: To calculate the factorial of a given positive integer, we have to multiply all the positive…
Q: Refer to the statement below, #include void main() { int i; int…
A: Algorithm: for (initialExpression; testExpression; updateExpression){ // body of the…
Q: Instructions: Kindly provide comments that explains the program code below. (NOTE: this is a C…
A: C is a programming language that is used in general-purpose. C language is considered to be a…
Q: In C++: Examine the code segment. What will be printed? If there are any errors indicate the nature…
A: The code given in question will give two compile time errors. Both the errors are indicated in bold…
Q: Write the value of each of the following expressions, using the following data declarations: double…
A: 1) (17.5 >12.0) &&(9/2<=4) property of &&(AND LOGICAL OPERATOR) is (true,…
Q: 3a. Floating point struct Define a struct Single that describes the bit layout for a single…
A: Algorithm:Define a struct Single to represent the bit layout of a single precision floating point…
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: 2. What is the output of this C code? void main(){ int a=0,i=0,b; for(i=0;i<5;i++){ a++; if(i==3)…
A: Here we have declared the variables and initialized them with 0. Next, we have a loop, that updated…
Q: w would you calculate the time spent on this code by the program in user mode ?
A: To calculate the time taken by the program one can use clock(). The implementation of clock() is…
Debug the following given C statement and write its output. Also attach the screenshots of output and code.
main()
{
int m,n;
for(i 0; i << 5; i++)
{
printf("\t\t\t\t");
for(j 0; j << 5; j+++)
printf("*");
printf("/n");
}
Step by step
Solved in 3 steps with 1 images
- #include <stdio.h>#include <stdlib.h>int LineFunc(void);int main(){int a, b;printf("Enter a :");scanf("%d", &a);printf("Enter b :");scanf("%d", &b);LineFunc();printf("\n\n");system("pause"); }int LineFunc(void){int i,j;int a=1, b = 0, y; for (i = -10; i < 11; i++){for (j = 10; j > -11; j--){y = a * i + b;if (i == 0 ){printf("-");}else if (j == 0){printf("|");}else if (i == 0 && j == 0){printf("+");}else if (y == j){printf("*");}elseprintf(" ");}printf("\n");} } Could you please write the code that gives different results for each value in the chart?#include <stdio.h>#include <stdlib.h>int LineFunc(void);int main(){int a, b;printf("Enter a :");scanf("%d", &a);printf("Enter b :");scanf("%d", &b);LineFunc();printf("\n\n");system("pause"); }int LineFunc(void){int i,j;int a=1, b = 0, y; for (i = -10; i < 11; i++){for (j = 10; j > -11; j--){y = a * i + b;if (i == 0 ){printf("-");}else if (j == 0){printf("|");}else if (i == 0 && j == 0){printf("+");}else if (y == j){printf("*");}elseprintf(" ");}printf("\n");} } Can you edit this code? and please run for me in c language.Refer to the statement below, #include void main() { int i; int number[11]={12,15,17,3,2,7,10,10,15,15,50}; for(i=0;i < 11; į++){ printf(" %d", number[i]); } Write a segment in C language to: Compute the average number Find the maхітит аnd minimum питber
- (Numerical) Write a program that tests the effectiveness of the rand() library function. Start by initializing 10 counters to 0, and then generate a large number of pseudorandom integers between 0 and 9. Each time a 0 occurs, increment the variable you have designated as the zero counter; when a 1 occurs, increment the counter variable that’s keeping count of the 1s that occur; and so on. Finally, display the number of 0s, 1s, 2s, and so on that occurred and the percentage of the time they occurred.In c void f (int *p, int * const q) { p=q *p=3; *p=4; } int i = 1, j =2; int main(){ f(&i, &j); printf("%d %d",i,j); return 0; } a. The program prints 1 2 and terminates b. the program prints 1 3 and 0 c. the program prints 1 4 and terminates d. the program prints 3 4 and terminates e. the program has compiler error#include <stdio.h>int main() { int x = 5866, y = 5455; int z = x; x = y; y = z; printf("%d %d", x, y); return 0;} Give output of this c code.
- #include int main() { } int a, b, c, i=0; for (c=0; c < 7; C++) { } for(b 0; b < c; b++) { } for(a 0; a < b; a++) { } return 0; shown above? printf("%d\n", i++); ) What is the final value of i in the codeChange this code into a program that receives a number and prints its divisors.( C language) #include <stdio.h> int main() { unsigned guess; /* current guess for prime */ unsigned factor; /* possible factor of guess */ unsigned limit; /* find primes up to this value */ printf("Find primes up to: "); scanf("%u", &limit); printf("2\n"); /* treat first two primes as special case */ printf("3\n"); guess = 5; /* initial guess */ while ( guess <= limit ) { /* look for a factor of guess */ factor = 3; while ( factor*factor < guess && guess % factor != 0 ) factor += 2;if ( guess % factor != 0 ) printf("%d\n", guess); guess += 2; /* only look at odd numbers */ } return 0; }#include <stdio.h>int main(){int d;int s[20],i, r, p, lg=0,m;char c;printf("Enter number of salesman(max 20): ");scanf("%d", &d);for(i=0; i<d; i++){ printf("\n salesman %d sales: ");scanf("%d", &s[i]);}for(i=0; i<d; i++){for(r=i+1; j<d; r++){if(s[i] > s[r]){p= s[i];s[i] = s[r];s[j] = p;}}}printf("\nsalesman lowest to highest: ");for(i=0; i<d; i++){printf("%d\t", s[i]);}for(i=0;i<m;i++){printf("\n highest sales: %d ",lg);if(lg<=s[i])lg=s[i];break;}getch();} >>> the upper part output should be like this enter number of salesman (max 20): 5 salesman 1 500 salesman 2 300 salesman 3 1000 salesman 4 200 salesman 5 1000 in the lower part the lowest to highest the output should become like this salesman 4 200 salesman 2 300 salesman 1 500 salesman 3 1000 salesman 5 1000 highest total sales : 2000
- #include <stdio.h>int main(){int d;int s[20],i, j, p, lg=0,m,t=0;char c;printf("Enter number of sale: ");scanf("%d", &d);for(i=0; i<d; i++){ printf("\n sales %d sales: ",i+1);scanf("%d", &s[i]);}for(i=0; i<d; i++){for(j=i+1; j<d; j++){if(s[i] > s[j]){p= s[i];s[i] = s[j];s[j] = p;}}}printf("\n sales lowest to highest: ");for(i=0; i<d; i++){printf("\nsales %d ", s[i]);}printf("\n highest: %d ",t);getch();} it should be: highest : 2000Fundamentals of Programming in C Language Write the value of each of the following expressions, using the following data declarations: double m = 17.5; int y = 9; 1. (m > 12.0) && (y / 2 <= 4) 2. (y % 3 != 0) 3. (m < 2 * y) 4. (2 == 3) || (m - 16 >= 0)void change( int a[]) , the compiler converts the parameter to: Select one: a. int *const a b. int &a; c. int a d. const int a; c++