Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include <cstdio>
- #include <iostream>
- using namespace std;
- int main()
- {
- int i = 0;
- char str[10];
- printf("Enter String : ");
- fgets(str,100,stdin);
- while (str[i] != '\0')
- {
- if (str[i] == 'a')
- {
- str[i] = '*';
- }
- i++;
- }
- printf("-------------------------------------");
- printf("\nString After Replacing 'a' by '*'");
- printf("\n-------------------------------------\n");
- printf("%s", str);
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement