#include <stdio.h>
int function()
{
int x, y;
printf("Enter the value of x:");
scanf("%d", &x);
y = 3*x*x*x*x*x + 2*x*x*x*x - 5*x*x*x - x*x + 7*x - 6;
printf("%d", y);
return y;
}
int main()
{
function();
}
Modify the program of Programming Project 5 so that the polynomial is evaluated using the following formula:
((((3x+2)x-5)x+7)x-6
#include <stdio.h>
int function()
{
int x, y;
printf("Enter the value of x:");
scanf("%d", &x);
y = (((3 * x+2) * x-5)*x+7) * x-6;
printf("%d", y);
return y;
}
int main()
{
function();
}
Note : Please comment below if you have concerns. I am here to help you
If you like my answer please rate and help me it is very Imp for me
#include <stdio.h> int function() { int x, y; printf("Enter the value of x:"); scanf("%d", &x); y...
#include<stdio.h> int main() { int i; printf("Type an integer value: "); scanf("%d",&i); evaluate(i); return(0); } void evaluate(int x) { if(x > 10) printf("Value entered by you is greater than 10"); else if(x < 10) printf("Value entered by you is less than 10"); else printf("Value entered by you is equal 10"); } _______________________________________ report for this in hr ?
Solve using C programming
3. lf you are given this code. #include <stdio.h> int main() int var1, var2; int sum; printf("Enter number 1:\n "); scanf("%d",&var1); printf("Enter number 2:In ); scanf("%d",&var2); sum-var1+var2; printf ("Vnsum of two entered numbers : %d", //printf ("Output: %d", res); sum); return e; Modify this code by creating a function called "addition". Make the arguments of the functions numberl and number 2. Add the two values in the function. Return a value called "result". Print "result" in...
1 Rewrite the following program so that it will use function. include <stdio.h> Int main) printf ("Hello!") return 0 2 Assume a program has the following declarations: short s- 4 int i--5; long m-3 float f-19.3f; double d-3.6; What are the following values? (a) s+m (b) (float) d (c) d s (e) (int) f 3 What will be the output of the following program: int x = 3 float a 2.76; y-2* x; print f("X-2d, y*ta, z»%d", x, y, z);...
#include<stdio.h> int main() { int data[10], i, j, temp; printf("Enter 10 random number to sort in ascending order:\n"); for(i = 0; i < 10; i++) scanf("%d", &data[i]); /* Sorting process start */ ****** INSERT YOUR CODE TO COMPLETE THE PROGRAM ****** printf("After sort\n"); for(i = 0; i < 10; i++) printf("%d\n",data[i]); return 0; } Looking for alternative solutions for the program code.
#include <stdio.h> void printHelp () { printf ("\n"); printf ("a: a(x) = x*x\n"); printf ("b: b(x) = x*x*x\n"); printf ("c: c(x) = x^2 + 2*x + 7\n"); printf ("q: quit\n"); } void a(float x) { float v = x*x; printf (" a(%.2f) = %.2f^2 = %.2f\n", x, x, v); } // end function a void b(float x) { float v = x*x*x; printf (" a(%.2f) = %.2f^3 = %.2f\n", x, x, v); } // end function b void c(float x)...
#include <stdio.h> int main() { int list[16]; int j, numItems; int temp; scanf("%d",&numItems); for(j=o; j< numItems; j++) scanf("%d",&list[j]); temp=list[0]; for(j=0; j<numItems-1; j++) list[j]=list[j+1]; list[numItems-1]=temp for(j=0; j< numItems-1;j++) printf("%d\t", list[j]); printf("\n"); return 0 } If someone could please turn this c program in pep 9 assembly language. Pep 9 not pep 8 please explain the logic and make sure to use the following four functions getlist() putlist() rotate(); putlist(); each function has two parameters Please do the source code not the...
can u please solve it in c++ format,,,, general format which is
#include<stdio.h> .......printf and scanf format
dont worry about the answers i have down
Q3, What is the output of the program shown below and explain why. #include #include <stdio.h> <string.h> int main(void) ( char str[ 39764 int N strlen(str) int nunj for (int i-0; i t Nǐ.de+ printf(") num (str[] 'e); I/ digits range in the ASCII code is 48-57 if (nue > e) f 9 printf( Xdin,...
Translate the following C program to Pep/9 assembly language. #include <stdio.h> int main() { int number; scanf("%d", &number); if (number % 2 == 0) { printf("Even\n"); } else { printf("Odd\n"); } return 0; }
#include<stdio.h> int functionl (int x, int y); int main() int ij=2,k; for(i=1;i<=5; i++) k = function1(ij); printf("k=%d\n",k); return 0; int function] (int x, int y) int z; z=x*2+y; return z;
1. What is the output of the following program? include <stdio.h> int wilma (int x) if (x<5) x = 7; return (x) int main (void) int x-1 x=wilma (x) ; printf ("%d", x); return (0) b)3 c) 4 d) 7 a) 1 e) none of these