Please help with writing this assignment in C, please include documenation. Usin
ID: 3533252 • Letter: P
Question
Please help with writing this assignment in C, please include documenation.
Using this program:
#include<stdio.h>
int sum (int, int);
{
int myint1;
int myint2;
int result;
printf ("Enter an integer:");
scanf ("%d",&myint1);
printf ("Enter a second integer: ");
scanf ("%d", &myint2);
result = sum (myint1, myint2);
printf ("The sum is %d. ", result);
return;
}
int sum (int val1, int val2)
{
int thissum;
thisum = val1 + val2;
return thissum;
}
1. Create a variable named index and initialize it to zero (0).
2. Prompt for and input a string value from the keyboard. Store the string variable newstring[80].
3. While (newstring[index] does not equal '')
i. Display the character at newstring[index] followed by a NL.
ii. Increment index
Write your program to use scanf to input the string. Input the following string: This is a test, then change your program to use gets instead of scanf to input the string. This should get the entire string.
Finally
What you should do is take the loop out of main and put it into a function. The purpose of the function is to accept a string then display the individual characters of the string to the screen one at a time.
1. 1. Prompt for and input a string value from the keyboard.
2. 2 Pass this value to a user defined function that will display each character in the string on a separate line of the screen.
3. 3 In main, thank the user for using your program.
The user function will need to:
1. 1 Accept the string as an input parameter. Name this string variable newstring
2. 2 Create a variable named index and initialize it to zero (0)
3. 3 While (newstring[index] does not equal