The answer to this question is as follows:
In the main method, the value of the maxLoc in the main is 1 after the execution of the findMax method
then the value of the max is 7
so the n=73572-(7*pow(10,1))
n=73572-70=73502
The output of the n is 73502
1 #include<stdio.h> 53 int findMax (int, SA 5 int main() 6 { int n; int max;...
what is output #include<stdio.h> pint main() { int i, j, total; for ( 2 { printf("\n"); for ( 2 { total = i + j; printf("%d", total); بہا } getchar(); return 0; } Find the for loop content | Output of progrm 5 15 1 11 21 31 41 51 61 2 12 22 32 25 3 13 23 33 43 53 63 4 14 24 34 44 54 64 35 45 6 16 26 36 46 56 66 7...
any help please? #include <stdio.h> #include <math.h> int main() { double borrow; double interest; double monthes; double payment; borrow= 15.090; interest= .00583; monthes=48; payment= borrow*(interset*pow(interest,48)+1)/(pow(interest,48)+1* - 1); return 0; } I'm trying to calculate the monthly payment but nothing shows up!
i need flowchart for the following c code #include <stdio.h> int main() { int n, i, sum = 0; printf("Enter an integer: "); scanf("%d",&n); i = 1; while ( i <=n ) { sum += i; ++i; } printf("Sum = %d",sum); return 0; }
Having an issue with pointers and functions. #include <stdio.h> int f(int *a, int *b); int main() { int a = 2, b = 7; b = f(&b, &a); printf("a = %d,\n", a); printf("b = %d\n", b); return 0; } int f(int* a, int* b) { (*a) = (*a) + 3; (*b) = 2*(*a) - (*b)+5; printf("a = %d b = %d\n", *a, *b); return(*a)+(*b); } can someone explain to me why the output is a =...
All in C please~ #1 Consider this program: #include <stdio.h> int main () { /* main */ constint constant1 = 10, constant2 = 20, constant3 = 14; int input_value; char current_truth; printf("What is the input value?\n"); scanf("%d", &input_value); current_truth = input_value > constant1; printf("current_truth = %d\n", current_truth); current_truth = current_truth && (input_value < constant2); printf("current_truth = %d\n", current_truth); current_truth = current_truth && (input_value == constant3); printf("current_truth = %d\n", current_truth); } /* main */ What is the output of this program...
#include <stdio.h> int main(int argc, char *argv[]) { int i; for (i = argc - 1; i > 0; i--) printf("%s ", argv[i]); printf("\n"); return 0; } can you explain this code in c and why use this function
Debug to print output "2 3 5 6 8 11": #include <stdio.h> #include <stdlib.h> int main() { int i, j, n; int A[] = {2, 3, 5, 5, 5, 6, 8, 11, 11, 11}; n = sizeof(A) / sizeof(int); for (i = 0; i < n - 1; i++){ if (A[i] != A[i + 1]) { for (j = 1; j < n - 1; j++) { A[j]...
#include <stdio.h> int josephus(int n, int k) { if (n == 1) return 1; else /* The position returned by josephus(n - 1, k) is adjusted because the recursive call josephus(n - 1, k) considers the original position k%n + 1 as position 1 */ return (josephus(n - 1, k) + k-1) % n + 1; } // Driver Program to test above function int main() { int n = 14; int k = 2; printf("The chosen place...
What is the output of the following code? #include« stdio.h» 2 4 int main() 6 int a=15,b=12,c=5, d-e; 7 printf("the value of d is %d",d); return 0; 8 9 10 Ly 0 29 O 30 0 28 O 31
Question 1 In the following incomplete C program: #include stdlib.h> #include <stdio.h> int main () { int i, n, max; int array[100]; ... } return 0; } an array of random int values is populated with n random values. Write only the code to find the location of the maximum value in the array. Question 2 Follow these instructions in your Linux account: 1. Create a file called data.txt in the root folder in your account. 2. Create a new...