🎧 New: AI-Generated Podcasts Turn your study notes into engaging audio conversations. Learn more

Modele intrebari licenta - 2024 - Facultatea de Informatica 1.pdf

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Full Transcript

UNIVERSITATEA TITU MAIORESCU FACULTATEA DE INFORMATICA MODELE ÎNTREBĂRI EXAMEN LICENȚĂ 2024 UNIVERSITATEA TITU MAIORESCU MODULUL 1 PROGRAMARE PROCEDURALA 1....

UNIVERSITATEA TITU MAIORESCU FACULTATEA DE INFORMATICA MODELE ÎNTREBĂRI EXAMEN LICENȚĂ 2024 UNIVERSITATEA TITU MAIORESCU MODULUL 1 PROGRAMARE PROCEDURALA 1. în care se pot memora cel mult de numere reale? x=float; double x; float x; real x(100); 2. ? (x5) (x5) (x=5) (x5) 3. ? (x>=1)||(x1)||(x1)&&(x1)&&(x=b) { a=a-b; t++; PROGRAMARE PROCEDURALA } printf("%d %d",t,a); C ? 7. sunt s=0; for(i=0;i=b); printf("%d %d",t,a); int t=0; while(a!=b) { a=a-b; t++; } printf("%d %d",t,b); int t=0; while(a%b==0) { a=a-b; t++; } printf("%d %d",t,a); 11. #include void sch(int a, int *b) PROGRAMARE PROCEDURALA { int aux; aux = a; a = *b; *b = aux; } int main() { int x = 1,y = 2; sch(x,&y); printf("%d",x+y); return 0; } C pe ecran programului de mai sus? 12. #include void sch(char a, char *b) { char aux; aux = a; a = *b; *b = aux; } int main() { char x = '1',y = '2'; sch(x,&y); printf("%c,%c",x,y); return 0; } Ce valori se vor pe ecran programului de mai sus? 13. #include PROGRAMARE PROCEDURALA void sch(int *a, int b) { int aux; aux = *a; *a = b; b = aux; } int main() { int x = 1,y = 2; sch(&x,y); printf("%d",x*y); return 0; } C pe ecran programului de mai sus? 14. #include void f(int a,int *b) { a++; *b=a; (*b)++; } void g(int *a,int b) { b++; *a=b; (*a)++; } int main() { int x=4, y=-2; f(x,&y); g(&x,y); printf("%d %d",x,y); return 0; } Ce valori se vor pe ecran programului de mai sus? PROGRAMARE PROCEDURALA 15. cea mai mare valoare din tabloul , format din numere întregi? max=0; for(i=0;imax) max=a[i]; max=a; for(i=0;ia[i+1]) max=a[i]; max=a; for(i=0;imax) max=a[i]; max=0; for(i=0;i0)||(a[i]%2!=0) (a[i]>=0)||(a[i]%2==0) 17. Care este valoarea expresiei strlen("programare")+strcmp("test","test")? 18. : PROGRAMARE PROCEDURALA char s; strcpy(s,""); strcat(s,"abcdefgh"); strcpy(s+2,s+4); printf("%s %d" ,s,strlen(s)); Ce se va a pe ecran executarea date? adefgh 6 abefgh 6 abfgh 5 abefgh 8 19. de tip logic ) , de lungime strcmp(s,s+5)==0 s==strstr(s,s+5) s==s+5 strcmp(s,strcat(s,s+5))==0 20. : char s[]="abcdabcd",c = 'c'; char *p = strchr(s,c); printf("%d",p - s); Ce se va a pe ecran executarea date? cdabcd 6 cd 2 21. : char s; strcpy(s,"abcdabcd"); strncat(s,s+2,3); strcpy(s,s+4); printf("%d",strlen(s)); Ce se va a pe ecran executarea date? 6 10 9 7 PROGRAMARE PROCEDURALA 22. : char s; strncpy(s,"abcdabcd",6); s='\0'; strcat(s,s+4); strcpy(s+3,s+6); printf("%s",s); Ce se va a pe ecran executarea date? abcabab abcdab abcab abcdabd 23. structuri: typedef struct { int zi,luna,an; }Data; typedef struct { char nume; Data data_nasterii; float media; }Student; variabila st este de tip Student de mai jos prin care luna valoarea : st->data_nasterii->luna=12; st.data_nasterii.luna=12; data_nasterii.luna=12; st.luna=12; 24. structuri: typedef struct { int zi,luna,an; }Data; typedef struct { char nume; PROGRAMARE PROCEDURALA Data data_nasterii; float media; }Student; variabila st este de tip Student de mai jos prin care anul valoarea : st->data_nasterii->an=1990; st.data_nasterii.an=1990; data_nasterii.an=1990; st.an=1990; 25. structuri: typedef struct { int x,y; }Punct_2D; typedef struct { Punct_2D p; int z; }Punct_3D; variabila a este de tip Punct_3D, de mai jos prin care toate cele coordonate ale punctului a se : a.p.x = a.p.y = a.p.z = 0; a.p.x = a.p.y = a.z = 0; a.x = a.y = a.z = 0; a.p = a.z = 0; 26. Punct Segment segment din plan, definite astfel: typedef struct { float x,y; }Punct; typedef struct { Punct A,B; }Segment; PROGRAMARE PROCEDURALA de tip Segment un segment vertical (aflat pe axa Oy sau paralel cu axa Oy)? s.A == s.B s.x == s.y A.x == B.x s.A.x == s.B.x 27. Punct Segment segment din plan, definite astfel: typedef struct { float x,y; }Punct; typedef struct { Punct A,B; }Segment; parametrului s de tip Segment? double f(Segment s) { return pow(s.A.x s.B.x,2)+pow(s.A.y s.B.y,2); } double f(Segment s) { return sqrt((s.A.x s.B.x)+(s.A.y s.B.y)); } double f(Segment s) { return s.B-s.A; } double f(Segment s) { return sqrt(pow(s.A.x s.B.x,2)+pow(s.A.y s.B.y,2)); } 28. int suma(int x,int y) x y, int prod(int x,int y) x PROGRAMARE PROCEDURALA y a, b c sunt variabile de tip întreg, care dintre expresiile de mai jos atribuie variabilei t de tip întreg valoarea expresiei (a+b)*(a+c)+b*c? t = prod(suma(a,b),suma(a,c),prod(b,c)); t = suma(prod(suma(a,b),suma(a,c)),suma(b,c)); t = prod(suma(a,b),suma(a,c)+suma(b,c)); t = suma(prod(suma(a,b),suma(a,c)),prod(b,c)); 29. int suma(int x,int y) x y int prod(int x,int y) x y a, b c sunt variabile de tip întreg, care dintre expresiile de mai jos atribuie variabilei t de tip întreg valoarea expresiei a*b+a*b*c? t = suma(prod(a,b),prod(a,b+c)); t = suma(prod(a,b),prod(a,b,c)); t = suma(prod(a,b),prod(prod(a,b),c)); t = prod(prod(a,b),suma(1,c)); 30. n? int f(int n) { int s=0; while(n!=0) { s=s+n%10; n=n/10; } return s; } int f(int n) { int s=0; while(n!=0) { s=s+n/10; n=n%10; } return s; } int f(int n) { int s=0; while(n!=0) { s=s + n%10; n=n/10; PROGRAMARE PROCEDURALA } } int f(int n) { int s=0; while(n!=0) { s=n%10; n=n/10; } return s; } 31. într-un program pentru a citi tablou unidimensional format din numere întregi? void citire(int v[],int n) { scanf("%d",&n); for(int i=0;i

Use Quizgecko on...
Browser
Browser