sol9 - 9 ' - 1. #include <stdio.h> #include...

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

View Full Document Right Arrow Icon
'סמ ליגרת-תונכת סרוק 9 ןורתפל אמגוד 1 תויתוא רודיס . #include <stdio.h> #include <ctype.h> #include <math.h> void order( char *c1, char *c2, int *distance); int main( void ) { char c1,c2; int dist; printf( "Please enter two letters\n" ); scanf( "%c %c" ,&c1,&c2); order(&c1,&c2,&dist); printf( "%c %c\n" ,c1,c2); printf( "The distance between the letters is %d\n" ,dist); return 0; } void order( char *c1, char *c2, int *distance) { char a1 = toupper(*c1); char a2 = toupper(*c2); *distance = abs(a1 - a2); if (a1 > a2) { a1 = *c1; *c1 = *c2; *c2 = a1; } } 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
2. םירפסמ השולש ןוימ #include <stdio.h> void sort3 ( double *a, double *b, double *c); double
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

sol9 - 9 ' - 1. #include &lt;stdio.h&gt; #include...

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