channel link : h ps://www.youtube.
com/c/ComputerScienceAcademy7
video link : h ps://youtu.be/OFHHny6n5MQ
/*
character : single alphabate, single digit or single symbol enclosed
in single inverted commas is called as character.
eg. 'a' '5' '+' 'b' 'D'
string : collec on of characters is called as string.
string is enclosed in double inverted commas.
eg. "hello" "Computer science" "12345" "a"
string : the one dimensional array of data type char is called
as string.
*/
/*
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int num[5] ={ 6,7,8,9,4};
float avg[10]= {0.1,5.6,9.6};
char str[50] = {'H','E','L','L','O'}; //declara on of string
for(int i =0; i<5; i++)
cout<<str[i];
getch(); '\0' NULL
}
-------------------------------
|'H'| 'E'|'l'| 'l'| 'O'|'\0'| str
--------------------------------
i= 0 1 2 3 4 5
*/
/*
//Declara on, ini aliza on and display of string.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
char line[100] = "Computer Science";
cout<<line;
getch();
}
*/
//Read and display string.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
char name[100];
cout<<"Enter your full name : ";
cin.get(name,100,'\n');
cout<<"hello "<<name;
getch();
}