You are on page 1of 1

COLEGIUL NATIONAL SFNTUL SAVA

CLASA a X-a A

NUME i PRENUME.........

Data

TEST DE VERIFICARE LA DISCIPLINA INFORMATICA


Completati efectul functiilor utilizate in programul C++, prezentat mai jos:
#include<iostream.h>
#include<string.h>
#include<conio.h>
void main()
{ char a[30]=culoare ,b[30]=galben,c[30],d[40];
int s,t;
clrscr();
cout<< primul sir = ;
cin.get(c,30);
cout<<c<<endl;.5p
cin.get();
cout<< al doilea sir = ; cin.get(d,40); cin.get();
cout<<d<<endl;....5p
s=strlen(a);
t=strlen(b);
cout<< s = <<s<<endl;

...5p

cout<< t = <<s<<endl;

...5p

cout<<strlen(c)<< <<strlen(d)<<endl;

5p

strcpy(a,b);
cout<< a = <<a<<endl;..5p
cout<< b = <<b<<endl; 5p
strcat(c,d);
cout<< c = <<c<<endl; . 5p
cout<< d = <<d<<endl; .5p
strncat(a,c,3);
cout<< c = <<c<<endl; . 5p
cout<< d = <<d<<endl; .5p
cout<< strchr(a,l)<<endl; . 5p
cout<< strchr(a,l)-a<<endl; . .5p
cout<< strrchr(a,l)<<endl; . 5p
cout<< strrchr(a,l)-a<<endl; . .5p
getche();
}
Observatii: 1. Se acorda 20puncte din oficiu.
2. Timp de lucru 10 min.

You might also like