{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# sol6 - 6 1#include #define SIZE 10 void...

This preview shows pages 1–2. Sign up to view the full content.

'סמ ליגרת-תונכת סרוק 6 ןורתפל אמגוד 1 ( ךרעמ לש תילגעמ הזזה #include <stdio.h> #define SIZE 10 void shift_to_end( int array[], int size); int main() { int i, shifts, array[SIZE]; printf("Enter %d numbres: \n",SIZE); for (i = 0; i < SIZE; ++i) { scanf("%d",&array[i]); } printf("Enter number of shifts: \n"); scanf("%d",&shifts); printf("\n"); for (i = 0; i < shifts; ++i) { shift_to_end(array,SIZE); } for (i = 0; i < SIZE; ++i) printf("%d ",array[i]); return 0; } void shift_to_end( int array[], int size) { int current = array[0], next, i; for (i = size; i > 0; i--) { next = array[(i-1)%size]; array[(i-1)%size] = current; current = next; } } 2 ( ןקת תייטס בושיח #include <stdio.h> #include <math.h> #define GRADES_RANGE 101 double std( int gradesHistogram[], int size); double avg( int gradesHistogram[], int size); int main() { int grade;

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
double average; int histo [GRADES_RANGE] = {0}; while (1) { printf( "Enter next grade:\n" ); scanf( "%d" ,&grade); if
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 2

sol6 - 6 1#include #define SIZE 10 void...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online