Computer Science Homework Solutions

Test the effect of a continue statement in the body of a for loop

what is printed for (putchar("1"):putchar("2"):putchar("3")){ putchar("4"): continue: putchar("5"): }

Write a program that prints out the first n primes, and n is input by the user

Also, write program in its own directory in three files, primes.h,mainc, and is-prime .c

write a function i svowel() that test whether or not charachter is a vowel

is written english generally understable without vowels

rewrite the program so that the messages like the following are printed

You win. or You lose rewrite so it look: You chose paper and I chose rock. You win THE ORGINAL PROGRAM IS C

write a function that shifts the stored value of five character variables in a circular fashion

the function definition starts as follows: void shift(char*p1,char*p2,char*p3,char*p4,char*p5) {

write a program implements this sort

simple sort for (i=0;i for (j=i+1;ja[j] swap(&a[i],&a[j]); then modify it so that all the elements of the array are printed sfter each pass of the outer loop 7 3 66 3 -5 22 -77 2

write interactive program that uses scanf()

need to read in 7 strings input by the user.It need to print the seven strings as list than sort them alfabeticaly and print new list.use strcmp() for sorting. Also use #define N_STRINGS 7

Write a program to test function then write and test an equivalent iterative function for GCD

write program to test function then write and test an equivalent iterative function int gcd (int a, int b) { int r; if ((r=a%b)==0) return b else return gcd(b,r); }

modify the code that if anything other than a digit string surrounded by optional white space is typed the inpuit is considered to be in arror

char line [MAXLINE]; int error,; do { printf("Input a positive integer: "); fgets(line, MAXLINE,stdin); error=sscanf(line,"%d",&n) !=1II n<=0; if(error) printf("|nERROR:Do it again.n"); } while(error);

What is printed in this program?

#include int main(void) { printf("Hello!n"); fclose(stdout); printf("Goodbye!n"); return0; }

Browse