Write a C Program That Uses Functions To Delete N – Charactres From A Given Position In A Given String.
#include <stdio.h> #include <conio.h> void del_str(char [],int, int); main() { int n,p; char str[30]; clrscr(); printf("\n Enter the String::"); gets(str); fflush(stdin); printf("\n Enter the position from where the characters are to be deleted:"); scanf("%d",&p); printf("\n Enter Number of characters to be deleted:"); scanf("%d",&n); del_str(str,p,n); printf("::End of the Main program::"); getch(); } void del_str(char str[],int p, int n) { int i,j; for(i=0,j=0;str[i]!='\0';i++,j++) { if(i==(p-1)) { i=i+n; } str[j]=str[i]; } str[j]='\0'; puts(" The string after deletion of characters::"); puts(str); }
Write a C program to calculate the following sum:
Sum = 1-x^2/2!+x^4/4!-x^6/6!+x^8/8!-x^10/10!
Write a C- Program To Determine If The Given String Is A Palindrome Or Not.
Find the time complexity of Binary Search Algorithm.
What is WAP? Why it is used?
Write short notes on: