0% found this document useful (0 votes)
35 views1 page

0 Float 50 50 50 "Write The Number of Entries " "%D" 0

This C code program takes user input for the number of entries (n) and then inputs values for arrays x and y of size n. It then performs calculations to fill out the 2D x array based on the values in y, outputting y and the calculated x values in a table.

Uploaded by

Ajeet Bhardwaj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views1 page

0 Float 50 50 50 "Write The Number of Entries " "%D" 0

This C code program takes user input for the number of entries (n) and then inputs values for arrays x and y of size n. It then performs calculations to fill out the 2D x array based on the values in y, outputting y and the calculated x values in a table.

Uploaded by

Ajeet Bhardwaj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

#include<stdio.

h>

#include<stdlib.h>

main()

int n,i,j,k=0;

float x[50][50],y[50];

printf("Write the number of entries\n");

scanf("%d",&n);

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

printf("Write the value x[%d] and y[%d] respectively\n",(i+1),(i+1));

scanf("%f%f",&y[i],&x[0][i]);

for(i=1;i<n;i++)

k=i;

for(j=0;j<n-i;j++)

x[i][j]=(x[i-1][j+1]-x[i-1][j])/(y[k]-y[j]);

k++;

}}

printf("\n\n");

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

printf("%f\t",y[i]);

for(j=0;j<n-i;j++)

printf("%f\t",x[j][i]);

printf("\n");

}}

You might also like