1. Create a variable named index and nitialize it to zero(0)
2. Prompt for and input a string value from thekeyboard. Store the string inthe string variable newstring[80].
3. While (newstring[index] does not equal ‘\0’).
i. Display the character at newstring[index] followed by a NL
ii. Increment index
======================================…
and this is what i have done so far and i dont know where i am wrong
Code:
#include<stdio.h>
int main()
{
int index = 0; //initialize index to zero since first elementin an array is numbered zero
char newstring[80];
printf("Enter a string\n");
scanf("%s", newstring);
while(newstring[index] != NULL)
{
newstring[index] = Null;
index++;
}
printf("You entered the string: %s\n",newstring);
return 0;
}