Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PROBLEM 1
- #include <stdio.h>
- //Your function prototype goes here
- int main(void)
- {
- //local declarations
- //declare an FLA array of integers
- for(; ; )
- {
- //add the number into the array
- }
- for(; ;)
- {
- printf("Element %d is %d\n", ?, ary[?]);
- }
- return 0;
- }//end main
- //Your new function would go here
- PROBLEM 2
- #include <stdio.h>
- //Your function prototype goes here
- int main(void)
- {
- //local declarations
- int ary[10];
- for(int i = 0; i < 10; i++)
- {
- ary[i] = i + 1;
- }
- for(int i = 0; i < 10; i++)
- {
- printf("Element %d is %d\n", i, ary[i]);
- }
- //call your function to reverse the array
- for(;;)
- {
- printf("Element %d is %d\n", //finish);
- }
- return 0;
- }//end main
- //Your new function would go here
- void reverseArray()
- {
- //local declarations
- //declare temp holding variable
- //Use two counters and make sure to start in the correct
- right index
- for(;;)
- {
- //save one item in temp
- //move one old item over the other
- //move temp to the old item destroying
- }
- return;
- }//end function
- PROBLEM 3
- #include <stdio.h>
- //Your function prototypes
- int main(void)
- {
- //local declarations
- //declare your array
- //local statements
- //loop to get values remember to use the ampersand for
- storage
- for(;;)
- {
- printf("Enter in 10 numbers one at a time: ");
- }
- for(;;)
- {
- printf("You entered: %d\n", );
- }
- return 0;
- }//end main
- //Function definition goes here
- PROBLEM 4
- #include <stdio.h>
- //Your function prototypes
- int main(void)
- {
- //local declarations
- int ary[10];
- //local statements
- for(int i = 0; i < 10; i++)
- {
- printf("Enter in 10 numbers one at a time: ");
- scanf("%d", &ary[i]);
- }
- /*for(int i = 0; i < 10; i++)
- {
- printf("You entered: %d\n", ary[i]);
- }
- */
- if(isbnTest(ary))
- printf("The ISBN is valid\n");
- else
- printf("The ISBN is invalid\n");
- return 0;
- }//end main
- //Function definition goes here
- int isbnTest()
- {
- //Local declarations for weighted sums
- int sum = 0;
- int value = 0;
- for(use two counters here)
- {
- value = ? * ?;
- sum+= value;
- }
- printf("The sum is %d\n", sum);
- return //determine if it is odd or even using modulus
- }//end fuction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement