#include<iostream> using namespace std; main() { char s[] = "Fine"; *s = 'N'; cout<<s<<endl; }
#include<iostream>
using namespace std;
main() {
char s[] = "Fine";
*s = 'N';
cout << s << endl;
}
Include Header Files: The
#include<iostream>
directive is used to include the necessary header file for input and output operations.Namespace Declaration: The statement
using namespace std;
declares that the program will use thestd
namespace, which includes the standard C++ library.Main Function: The
main()
function is the entry point of the program.Character Array Declaration:
char s[] = "Fine";
declares a character arrays
and initializes it with the string "Fine".Modify Array Element:
*s = 'N';
changes the value of the first element of the character arrays
from 'F' to 'N'.Output Statement:
cout << s << endl;
prints the modified strings
to the standard output (console) followed by a newline.