Question: Int r; Double value While((r=scanf(%lf, &value))==1 && ptr *ptr++==value: If(r==1) Printf(entered more than %i values, max); Else if (r !=EOF) Printf(invalid character data entered) In

Int r;

Double value

While((r=scanf(%lf, &value))==1 && ptr

*ptr++==value:

If(r==1)

Printf(entered more than %i values, max);

Else if (r !=EOF)

Printf(invalid character data entered)

In C WITHOUT USING BREAK. How to change tablefill below to look like the code above.

#include //function to read array of values int table_fill(int A[],int m,int sentinel) { int *a=A; int i; int n=0;//variable declarations //prompting input printf("Enter integer values :(Max values to be entered is %d)(-999 to stop)"); i=0; while(i void Table_print(int A[],int m) { int *a = A; int *endPtr = A + m; while( a < endPtr) { printf("%d ",*a); a++; } printf(" "); } int table_diff(const int a [], const int b[], int m, int n) { const int *ptra=a; const int *ptrb=b; const int * const endptra=a+m; const int * const endptrb=b+m; while(ptra < endptra &&ptrb

int main() { //variable declarations int max=10;//max size of the array... int sentinel=-999;//sentinel value to stop reading //integer arrays int a[10];//first array int b[10];//second array int m = table_fill(a,max,sentinel);//calling table fill function int n = table_fill(b,max,sentinel); printf("Array1 :");//printing array Table_print(a,m); printf("Array1 :");//printing array Table_print(b,n); int index=0; index = table_diff( a , b, m, n);//finding the difference index //printing output if(index==-1) { printf("same "); } else { printf("array start to differ at index %i", index); } return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!