Tuesday, 9 September 2025

Accept Coefficient value

 

#include<stdio.h>

int main() {

    int n; // Degree of the polynomial + 1

    printf("Enter the number of terms in the polynomials: ");

    scanf("%d", &n);

 

    int poly1[100]; // Arrays for the two polynomials and the result

 

    // Input for the first polynomial

    printf("Enter the coefficients of the first polynomial:\n");

    for (int i = 0; i < n; i++) {

        printf("Coefficient of x^%d: ", i);

        scanf("%d", &poly1[i]);

    }

  

    return 0;

}