Write a C Program to extract a portion of a string from a character string using for loop <pre><code>#include&lt;stdio.h&gt; #include&lt;string.h&gt; void main() { char str1[50],str2[50]; int i,j,n,m,l; clrscr(); printf("Enter the string\n"); gets(str1); //scanf ("%s",str1); printf("Enter the position of the required character: "); scanf("%d",&amp;n); printf("Enter the required number of characters to be extracted: "); scanf("%d",&amp;m); l=strlen(str1); if(m+n-1&lt;l) { for(i=n-1;i&lt;m+n-1;i++) { for(j=0;j&lt;i;j++) { str2[j]=str1[i]; str2[j]='\0'; } } printf ("The extracted string is: %s",str2); } else printf ("string extraction is not possible"); } </code></pre> <p>Expected Output </p> <pre><code>Enter the string : UNIVERSITY IN BANGALORE Enter the position of the required character: 6 Enter the required number of characters to be extracted: 4 The extracted string is: SITY </code></pre>