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

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

View Full Document Right Arrow Icon
'סמ ליגרת-תונכת סרוק 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;
Background image of page 1

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

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

This note was uploaded on 01/10/2010 for the course CS 463 taught by Professor Can'tsay during the Spring '09 term at Haaga - Helia University of Applied Sciences.

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 Right Arrow Icon
Ask a homework question - tutors are online