This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| int swap(int a, int b) { | |
| int temp = a; | |
| a = b; | |
| b = a; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #define LINII 3 | |
| #define COLOANE 3 | |
| void afisare(int m[LINII][COLOANE]) { | |
| for(int i = 0; i < LINII; ++i) { | |
| for(int j = 0; j < COLOANE; ++j) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| int main(int argc, char const *argv[]) | |
| { | |
| int linii, coloane; | |
| printf("Numarul de linii: "); | |
| scanf("%d", &linii); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| void afiseaza(int v[], int n) { | |
| for(int i = 0; i < n; ++i) { | |
| printf("%d ", v[i]); | |
| } | |
| printf("\n"); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| int main(int argc, char const *argv[]) | |
| { | |
| int numere[] = {-23,5,12,33,101,47,3311,331}; | |
| // 1....rest | |
| int n = sizeof(numere) / sizeof(numere[0]); | |
| //pornim presupunand ca primul element este si minimum si maximum |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| //de implementat | |
| //{64,34,25,12,11,90}; | |
| // i i+1 | |
| void afisare(int v[], int n) { | |
| for(int i = 0; i < n; ++i) { | |
| printf("%d ",v[i]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| //Cautare liniara | |
| int main(int argc, char const *argv[]) | |
| { | |
| //declaram un array de numere intregi | |
| int numbers[] = { 5, 12, 8, 120, 44, 7,123, 90}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| /* | |
| Algoritmul lui Euclid | |
| Cel mai mare divizor comun (a,b) | |
| (10,3) = 1 | |
| (10,4) = 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| int main(int argc, char const *argv[]) | |
| { | |
| int a = 24;//declar o variabila de tip intreg | |
| int b = 2;//declar o variabila de tip intreg | |
| int r = a;//declar o variabila de tip intreg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| using namespace std; | |
| int main(int argc, char const *argv[]) | |
| { | |
| int a = 10, | |
| b = 12; | |
| cout<<"a = "<<a<<endl; |