Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<conio.h>
- #include<math.h>
- #include<stdlib.h>
- #include<string.h>
- void replaceSubstring(char *str, char *substr);
- int main()
- {
- int doloop = 1;
- char *str = (char *)(malloc(100));
- if (str == NULL)
- {
- printf("No memory allocated");
- return;
- }
- char *substr = (char *)(malloc(100));
- if (substr == NULL)
- {
- printf("No memory allocated");
- return;
- }
- // we gets the text and substring, then we check if the substring is in the text the we change the letters from small to capital .
- while (doloop)
- {
- printf("Enter Text: ");
- gets_s(str, 100);
- //empty text
- if (*str == '