Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

გიორგი გვაზავა 108938-1 დავალება 13

1. SeadgineT programa, romelic nebismieri teqstis Semcveli striqonis kopirebas moaxdens sxva striqonSi.
#include <iostream>
#include <string>
#include <cmath>
#include <iomanip>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
int main()
{
char str1[]="Lorem issum";
char str2[40];
char str3[40];
strcpy (str2,str1);
strcpy (str3,"copy successful");
printf ("str1: %s\nstr2: %s\nstr3: %s\n",str1,str2,str3);

system("pause");
return 0;
}

2. SeadgineT programa, romelic nebismieri teqstis Semcveli striqonis pirvel Svid simbolos sxva striqonSi
amatebs.
#include <iostream>
#include <string>
#include <cmath>
#include <iomanip>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
int main()
{
char str1[]="Lorem issum dollar sit amet bir...";
char str2[30];
char str3[30];
strncpy (str2, str1, 11);
strcpy (str3,"copy successful");
printf ("str1: %s\nstr2: %s\nstr3: %s\n",str1,str2,str3);

system("pause");
return 0;
}
გიორგი გვაზავა 108938-1 დავალება 13

3. SeadgineT programa, romelic nebismieri teqstis Semcvel oTx masivs erTmaneTTan Seadarebs da
gansazRvravs TiToeul masivSi Semavali striqonis sigrZes.
#include <iostream>
#include <string>
#include <cmath>
#include <iomanip>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
int main()
{
char leftStr[] = "L o r e m";
char rightStr[] = "i s s u m";

char leftStr_2[] = "w h a t i s L o r e m";


char rightStr_2[] = "i s s u m d o l a r";

int response_1 = strcmp(leftStr, rightStr);

if (response_1 == 0)
{
printf("pirveli ori masivi tolia");
}
else
{
printf("pirveli ori masivebi ara tolia");
}

int response_2 = strcmp(leftStr_2, rightStr_2);


if (response_2 == 0)
{
printf("meore ori masivi tolia");
}
else
{
printf("\nmeore ori masivebi ara tolia\n");
}
system("pause");
return 0;
}
გიორგი გვაზავა 108938-1 დავალება 13

4. SeadgineT programa, romelic gansazRvravs TqvenTvis saintereso simboloebisa da cifrebis raodenobas


mocemul striqonSi.
#include <iostream>
#include <string>
#include <cmath>
#include <iomanip>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
int main()
{
char myString[] = "lorem ipsum dollar sit amet bir...";
int stringLength = strlen(myString);
cout << "String: " << myString << endl << "Length of String: " << stringLength <<
endl;

system("pause");
return 0;
}
გიორგი გვაზავა 108938-1 დავალება 13

5. SeadgineT programa, romelic toupper( ) funqciis gamoyenebiT ama Tu im striqonSi patara simboloebs
Sesabamisi didi simboloebiT Secvlis.
#include <iostream>
#include <string>
#include <cmath>
#include <iomanip>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <cctype>
#include <cstring>
#include <cstdio>

using namespace std;


int main()
{
char myString[] = "lorem ipsum dollar sit amet bir...";

cout << "Chveulebrivi: " << myString << endl << "Uppercase: ";

for (int i=0; i<strlen(myString); i++)


{
putchar(toupper(myString[i]));
}
cout << endl;

system("pause");
return 0;
}

You might also like