SVET PROGRAMIRANJA
  • HOME
  • WEB PROGRAMMING
    • Popular programming languages today
    • Programming trends
    • Internet of things
    • Creating web application
    • Frontend and backend programming
    • Creating Simple Website >
      • Create Your Logo Home
      • Create Your Logo CSS
    • Creating python web application >
      • Creating a Django Web Application - Getting Started
    • ASP.NET CORE web application >
      • ASP.NET CORE web application introduce >
      • Servicing static web pages using a web server
      • Creation of a sql web api service that reads data from the database
      • Creating a controller in an asp.net web API application
      • Communication of the Javascript web application with the API server
  • Algorithms
    • Algorithms Guide
    • Mathematical algorithms >
      • Array of Fibonacci
      • A prime numbers and factoring
      • Eratosthenes sieve
      • The Euclidean algorithm
      • The maximum sum of subarrays
      • Fast exponentiation algorithm
    • Structures and Unions >
      • Introduction to structures and unions
      • Disjoint Set Union (DSU) structures
      • Basic data structures
    • Sorting arrays >
      • Merge-sort
      • Quick-sort
    • Binary search
    • Recursion and dynamic programming >
      • Recursive algorithms
        • Tower of Hanoi algorithm
      • Introduction to dynamic programming
      • DP: Fibonacci with memoization
      • DP: Knapsack problem – Explanation and examples
      • Longest Common Subsequence (LCS)
    • Graphs and Trees >
    • Advanced techniques >
      • Greedy Algorithms
  • Examples in C,C++,Java
    • Basic Examples >
      • Data examples in C/C++
      • Selection statements in C/C++ - examples
      • Loops in C/C++ examples >
        • Loops in C/C++ examples basic
        • Nested loops in c and c++ examples
      • Arrays in C/C++ examples
      • Strings in C/C++ examples
      • Sorting arrays in C/C++ examples
      • Two dimensional arrays in C/C++ - examples
      • Functions in C/C++ - examples
      • Algorithms examples >
        • Recursive algorithms examples
    • Additional examples with solutions >
      • Data in C - additional examples
      • Selection statement - additional
      • Loop - additional
      • Clasess and objects- additional
    • Preparations for competitions in informatics >
      • Preparations for qualifications for distict competitions
      • Qualifications for distict competitions
      • Preparation for the national competition
    • Tests >
      • Test from "Selections statements"
  • Programming languagages
    • Learn C >
      • Introducing to C and C++
      • Basics about C and C++
      • Data in languages C
      • Operators in C/C++
      • Selection Statements in C/C++
      • Loops in C/C++ >
        • Loops in C/C++ basic
        • Nested loops in c and c++
      • Arrays in c and cpp >
        • Onedimensional Array in c and c++ basic
        • Vectors in c and c++
        • Two-dimensional array-matrix in c and c++
        • Maps in c and c++
      • Strings in C/C++
      • Two-dimensional arrays
      • Pointers in C/C++
      • Functions in C
    • learn C++ >
      • Introducing to C++
      • Data in C++
      • Operators in C++
      • Selection Statements in C++
      • Loops in C++ >
        • Loops in C++ basic
        • Nested loops in c++
      • Arrays in c++ >
        • Introduction to an Array in c++
        • Vectors in c++
        • Two-dimensional array-matrix in c++
        • Maps in c++
        • Two dimensional dynamic arrays in c++
      • Strings in C++
      • Two-dimensional arrays
      • Pointers in C++
      • Functions in C++
    • Learn JAVA >
        /*JAVA*/
      • Introducing to JAVA
      • Java Basic >
        • Data in JAVA programming
        • Selections statements in JAVA
        • Operators in JAVA
        • Loops in JAVA
        • Arrays in JAVA
      • Object oriented programming >
        • Understanding Java as an Object-Oriented Language
        • Classes and Objects
        • Inheritance of classes
        • Abstract classes and interfaces
        • The visual part of the application >
          • Graphical user interface
          • Events in Java
          • Drawing in window
          • Graphics in JAVA-example
          • Animations in JAVA-examples
          • Applications in JAVA-examples
      • Distance learning java
    • Learn Processing >
      • Intoduction to processing
      • Basic of processing using JAVA
      • Processing and microbit
      • Using vectors in Processing >
        • Vector operations application
      • Processing 2D >
        • Creating Projectile motion animation
        • Processing example: Soccer game shoot
        • Body sliding down a inclined plane
        • Analisys of an inclined plane
        • Circular motion animation in processing
      • Processing 3D >
        • Introducing to 3D processing
        • Movement of 3D objects in processing
    • Arduino and ESP32 programming >
      • Learn Arduino Programming >
        • Intoduction to arduino
        • LDR sensor(light sensor) exercises
        • Arduino temperature sensor - exercises
        • Measuring an unknown resistor
        • Arduino -Ultrasonic sensor
        • introduction to servo-motors on arduino
        • Moisture soil sensor
      • Learn ESP32 Programming >
        • Intoduction to ESP32
        • ESP32 with servo motors exercise
  • MORE
    • Privacy Policy
    • Links
    • Distance learning

Srpski | English

​Functions in C/C++ - examples


If you want to learn about the functions in C and C++, visit the webpage: Functions in Functions in C or Function in C++

1. Replacement of the position

Load two integers of X and Y. Create a function that changes the positions of two integer variables. Use this function and replace the values ​​with X and Y variables.

2. Is the number simple?

Make a function that determines whether a number is simple. Enter a natural number and examine whether it's free.

3. Printing the array

Enter n. Then Enter n elements of that array. Create a special method for writing it. Use that method to print the array elements on the screen.​

4. Extracting even elements of an array

​Enter an array of n elements. The number n, as well as the elements of the array, is entered by the user. Create a method that overwrites even elements from the initial array. Use the created method to extract even elements from the initial sequence.

5. Number of repetitions of a certain character

​Enter some text from the keyboard. Create a special function that counts the passed character. Use the function to determine the number of repetitions of the letter "p" in the entered text.

6. Daily earnings

Michael is employed part-time and earns a daily income for his work. He writes down the dates and the value of that day's earnings in his notebook because he keeps records of it. Create a program that will help Michael to load date values ​​with earnings that are entered so that one date with daily earnings can be loaded in one row. Create a function that separates the dates and earnings from the passed array of daily earnings into two separate arrays in which these data are defined, the date as a string and the earnings as a real number. The date is entered in the format dd_mm__yyyy (date, month, year)

Example:
Input:

12_2_2021 2045.33
23_8_2021 1034.66
15_4_2021 1567.99

Output:
Array 1:
12.02.2021
23.08.2021
15.04.2021

Array 2:
2045.31
1034.66
1567.99

7. Login

​Create a method (function) for user login based on entering a username and password. Allow the user to attempt a maximum of 3 password attempts. The method should give an answer whether the user is successfully logged in or not. Call the function from the main method. If the method returns that the user is logged in, then print the message: "The user is successfully logged in", otherwise write "The user is not successfully logged in". The username and password combination is known to be correct: admin user.
​
Example:
Input:
Enter your username and password:
"Tot"
"user1"
Re-enter incorrect password
"admin"
"user"
Exit:
The user is successfully logged in

8. Daily earnings

    Mihajlo is employed part-time and earns a daily income for his work. He writes down the dates and the value of that day's earnings in his notebook because he keeps records of it. Create a program that will help Mihajlo to load date values ​​with earnings that are entered so that one date with daily earnings can be loaded in one row. Create a function that separates the dates and earnings from the passed string of daily earnings into two separate strings in which these data are defined, the date as a string and the earnings as a real number. The date is entered in the format dd_mm__yyyy (date, month, year).

Example:
Input:

12_2_2021   2045.33
23_8_2021   1034.66
15_4_2021   1567.99

Output:
Array1:
12.02.2021
23.08.2021
15.04.2021

Array2:
2045.31
1034.66
1567.99



9. Login

    ​Create a method (function) for user login based on entering a username and password. Allow the user to attempt a maximum of 3 password attempts. The method should give an answer whether the user is successfully logged in or not. Call the function from the main method. If the method returns that the user is logged in, then print the message: "The user is successfully logged in", otherwise write "The user is not successfully logged in". The username and password combination is known to be correct: admin user.

Example:
Input:
Enter your username and password:
"Mika"
"user1"
Re-enter incorrect password
"admin"
"user"
Output:
The user is successfully logged in

10. Determination of the maximum

​Create a function that determines the maximum of two integers passed as function parameters.
Enter two integers and determine their maximum using the previously defined function.

Create the function "maximum()", which receives two integers, a and b, as parameters, and then, inside the function, examine which of them is larger.

If "a" is greater, the function should return "a" as a return value, otherwise "b".

Inside the main function, enter two integers, then call the previously created maximum function to determine it. Print that value in the rest of the program.

#include < stdio.h>

/*Solution for C programming language*/

int maximum(int a, int b)
{
if(a>b)
{
return a;
}
else
{
return b;
}
}

int main()
{
int a,b,maxAB;
printf("a=?,b=?\n");
scanf("%d%d",&a,&b);
maxAB = maximum(a,b);
printf("Maximum is %d",maxAB);
return 0;
}

11. Determining whether a number is prime

Create a function that checks if the number passed to it as a parameter is prime. Enter an integer and determine if it is prime using the previously defined function.
Read more about prime numbers on the website: A prime numbers and factoring
#include < stdio.h>

/*Solution in the programming language C*/

int prime(int a)
{
int res=1;
if(a==1 || a==2){
return 1;
}
int d=2;
while(d < a){
if(a % d == 0){
res=0;
break;
}
d++;
} return res;
}

int main()
{
int x;
printf("x=?\n");
scanf("%d",&x);
if(prime(x)){
printf("The number %d is prime",x);
}
else{
printf("The number %d isn't prime",x);
}
return 0;
}

12. Writing bits from left to right

​​Write a function that prints the bits of x from left to right.

Create a function "bits()", which receives an integer "a" as a parameter.

Inside the function, use a loop to create powers of 2, starting with 215, and then decrease the exponent through the cycles.

Check in each cycle, whether that power of two is less than the rest of the number, which is initially equal to the whole number "a" sent.

If yes, print 1 as bit, if not, print zero. Recalculate the remainder of the number that remains when we subtract the current power of 2 from the previous remainder.

In the main "main" function, call the previously created function to be executed.

#include < stdio.h>

/*Solution in the programming language C*/

int bits(int a)
{
int rem = x; //7
for(int i = 15;i >= 0;i--){
int a=(int)pow(2,i);
if(a <= rem){
printf("1 ");
rem=rem % a; //a=4, rem =7%4=3; a=2, rem =3%2=1; a=1, rem =1%1=0
}
else{
printf("0 ");
}
}
printf("\n");
}

int main()
{
int x;
printf("x=?\n");
scanf("%d",&x);
bits(x);
return 0;
}

13. Rounding to K decimal places.

​​Write a function that prints the quotient of natural numbers M/N to k decimal places

Enter three integers M,N and K. (eg 13,3,2)

Find the quotient M/N, (eg 13/3=4.333333), and choose double or float as the data type, in order to save the decimals.

Multiply the resulting number by 10K, and then convert that number into a whole number, so that it contains both the digits of the result and the digits that should be displayed after the decimal point (eg 433).

Extract the integer result from this number, by dividing by 10K, as well as the decimal part by looking for the remainder of the division by 10K.

Print the integer part first, then put "." and add the decimal part below.

#include < stdio.h>

/*Solution in programming language C*/

int main()
{
int M,N,K,res,coef;
double resD;
printf("M=?,N=?,K=?\n");
scanf("%d%d%d",&M,&N,&K); //13,3,2
resD=(double)M/N; //4.333333
printf("res=%f\n",resD);
coef=(int)pow(10,K); //100
res=resD*coef; //433
resD=(double)res/coef; //4.3300000
printf("res=%g\n",resD);
int num,dec;
num=res/coef; //4
dec=res % coef; //33
printf("%d.%d\n",num,dec);
}

14. Combinatorics-Calculation of combinations.

Write a program to calculate
for the given natural numbers n,k,p S=Cn k-Cn k+1 +..+(-1) p*Cn k+p,
according to the formula for calculating combinations
Solution

15. Bit in the given position.

    Write a function that reports whether there is a 1 at position pos, the argument of the function (parameter) X. The bit positions are numbered, from right to left, starting from position 1.

16. Number in reverse order.

If the number M1 is obtained from the number M by writing its digits in inverse order, write a program that prints all pairs of three-digit numbers (a,b) that have the property: If A*B=C, then A1*B1=C1. E.g:
312 * 221 = 68952
213 * 122 = 25986

17. The closest number that satisfies the condition.

If S(n) denotes the sum of digits in the decimal notation of the number n, determine n such that it is the nearest number smaller than 2003, for which the equality holds:
n+S(n)+S(S(n))+S(S(S(n)))+S(S(....S(n)....)=2003

17. Calculating the factorial of n.

​Create a function that calculates the factorial of n. Inside the main function, load n and use the previously created function to calculate the factorial of that number.

Enter a number, e.g. 5. Call a separate function that computes the factorial and pass n as a parameter. Factorial function: Check if n == 0 and if so return 1 (because 0! = 1). Then compute the product in a loop, multiplying the running product by the loop variable i. Decrease the loop variable from n down to 1.

<!-- C solution -->
#include <stdio.h>

/* C solution (compilable in C89/C99 and newer) */

int factorial(int n)
{
int i;
int f;
if (n == 0)
{
/* 0! = 1 */
return 1;
}
if (n < 0)
{
/* Factorial of negative numbers is undefined here */
return -1; /* error indicator */
}
f = 1;
for (i = n; i > 0; i--)
{
f = f * i;
}
return f;
}

int main(void)
{
int n, f;
printf("Enter an integer n: ");
if (scanf("%d", &n) != 1)
{
printf("Invalid input\n");
return 1;
}

if (n >= 0)
{
f = factorial(n);
printf("Factorial is %d\n", f);
}
else
{
printf("You cannot enter a negative number\n");
}

return 0;
}

<!-- C++ solution -->
#include <iostream>

/* C++ solution (compilable with modern C++ compilers) */

unsigned long long factorial(int n)
{
if (n == 0) return 1ULL; /* 0! = 1 */
if (n < 0) return 0ULL; /* error indicator: returning 0 */
unsigned long long f = 1ULL;
for (int i = 1; i <= n; ++i)
{
f *= (unsigned long long)i; /* beware of overflow for large n */
}
return f;
}

int main()
{
int n;
std::cout << "Enter an integer n: ";<br>
if (!(std::cin >> n))
{
std::cout << "Invalid input\n";
return 1;
}

if (n < 0)
{
std::cout << "You cannot enter a negative number\n";
return 0;
}

unsigned long long result = factorial(n);
std::cout << "Factorial is " << result << std::endl;
return 0;
}

​Combined tasks with the use of functions

Task 1: Shift array elements to the left (rotation)

Write a function in C that shifts all elements of an array one position to the left (cyclic rotation). The function should modify the array in-place, and the last element should become the previously first element.

  • Create a function cycle_left that takes parameters int A[] and int n.
  • In the main function: read the size n, input n array elements, call cycle_left, and then display the result using the helper function print_array.
  • Pay attention to edge cases: n <= 1 (array remains unchanged).

Short explanation of the task:

The goal is to demonstrate how an array can be modified directly in a function (by passing a pointer to the first element) and to understand a simple algorithmic operation of shifting elements (O(n) time complexity).

Instructions (steps):

  1. Read an integer value n.
  2. Allocate/define an array of n elements and read their values.
  3. In the function cycle_left(A, n), save the first element in a temporary variable, shift elements A[1]..A[n-1] to the left, and assign the saved element to the last position.
  4. Call the helper function print_array(A, n) to display the result.
  5. Take care of edge cases: if n <= 1 the function should return immediately.
#include <stdio.h>
#include <stdlib.h>

/* Function for cyclic left shift of an array by one position */
void cycle_left(int A[], int n) {
    if (n <= 1) return;

    int b = A[0];
    for (int i = 1; i < n; i++) {
        A[i - 1] = A[i];
    }
    A[n - 1] = b;
}

void print_array(int A[], int n) {
    printf("print_array:\n");
    for (int i = 0; i < n; i++) {
        printf("%d ", A[i]);
    }
    printf("\n");
}

int main() {
    int n;
    if (scanf("%d", &n) != 1) return 0;

    /* Note: VLA (C99) is used. For older standards, use malloc. */
    int arr[n];
    for (int i = 0; i < n; i++) {
        printf("Enter element %d of the array\n", (i + 1));
        scanf("%d", &arr[i]);
    }

    cycle_left(arr, n);
    print_array(arr, n);

    return 0;
}

Task 2: Sorting an array using Bubble Sort

Write a C program that sorts an array of integers using the standard Bubble Sort algorithm. Implement a function bubble_sort that takes an array and its length and sorts the elements in-place. In main, read the array size, input the elements, call the sorting function, and display the result.

  • Create a function bubble_sort(int A[], int n).
  • Add a helper function print_array to print the array.
  • Optimize Bubble Sort to terminate early if the array is already sorted (using a flag).

Short explanation of the task:

Bubble sort compares adjacent pairs and, if needed, swaps them so that the largest element “bubbles up” to the end in one iteration. Repeat the process until the array is sorted. The algorithm is simple to implement (and stable), but has a time complexity of O(n²).

#include <stdio.h>
#include <stdlib.h>

/* Helper function to print an array */
void print_array(int A[], int n) {
printf("print_array:\n"); for (int i = 0; i < n; i++) {
printf("%d ", A[i]);
} printf("\n");
} /* Bubble sort (optimized version with early exit flag) */ void bubble_sort(int A[], int n) {
for (int pass = 0; pass < n - 1; pass++) {
int swapped = 0; for (int i = 0; i < n - pass - 1; i++) {
// If element at i is greater than the next one, swap if (A[i] > A[i + 1]) {
int temp = A[i]; A[i] = A[i + 1]; A[i + 1] = temp; swapped = 1;
}
} if (!swapped) {
// No swaps in this pass — array is already sorted break;
}
}
} int main() {
int n; // Read array size scanf("%d", &n); // Note: VLA (C99) is used. For older standards, use malloc. int arr[n]; for (int i = 0; i < n; i++) {
printf("Enter element %d of the array\n", (i + 1)); scanf("%d", &arr[i]);
} // Sorting bubble_sort(arr, n); // Print sorted array print_array(arr, n); return 0;
}

Explanation of the solution

  • Principle: Bubble sort compares adjacent elements and, by swapping the larger with the smaller, moves larger elements toward the end.
  • Optimization: We use a variable swapped to terminate early if there were zero swaps in a full pass — meaning the array is already sorted.
  • In-place: Sorting modifies the passed array directly (no extra memory needed except for temporary temp).
  • Stability: Bubble sort is a stable algorithm — the relative order of equal elements is preserved.
  • Time complexity:
    • Worst and average case: O(n²).
    • Best case (already sorted, thanks to the flag): O(n).
  • Space: O(1) extra memory (only temp and the flag).
  • C compatibility note: if you want portability to older C compilers, use malloc and free instead of VLA.

Extension (optional): Implement a version that sorts in descending order or one that returns the number of passes required to sort.

Task 3: Reverse an array

Write a program in C that implements a function to reverse the elements of an integer array in-place. The function should swap the elements so that the first becomes the last, the second becomes the second-to-last, and so on. In main, read the size of the array, input the elements, call the reverse function, and display the result.

  • Create a function reverse_array(int A[], int n) that modifies the array directly.
  • In main: read n, fill the array, call reverse_array, and then print the array using print_array.
  • Pay attention to edge cases (n <= 1).

Short explanation of the task:

The goal is to demonstrate array manipulation using two indices (left/right) and swapping elements until they cross. The algorithm works in-place with O(1) extra memory and time complexity O(n).

#include <stdio.h>
#include <stdlib.h>

/* Helper function to print an array */
void print_array(int A[], int n) {
printf("print_array:\n"); for (int i = 0; i < n; i++) {
printf("%d ", A[i]);
} printf("\n");
} /* Function that reverses an array 'in-place' using two pointers */ void reverse_array(int A[], int n) {
// If the array is empty or has one element, nothing to change if (n <= 1) {
return;
} int left = 0; int right = n - 1; while (left < right) {
int tmp = A[left]; A[left] = A[right]; A[right] = tmp; left++; right--;
}
} int main() {
int n; // Read the size of the array scanf("%d", &n); // Note: using VLA (C99). For older standards use malloc. int arr[n]; for (int i = 0; i < n; i++) {
printf("Enter element %d:\n", (i + 1)); scanf("%d", &arr[i]);
} // Call the function that reverses the array reverse_array(arr, n); // Print the result print_array(arr, n); return 0;
}

Solution explanation

  • The function reverse_array uses two indices: left starts from index 0, and right from the last element.
  • In the while loop, as long as left < right, we swap the values at those positions using a temporary variable tmp. Then we increment left++ and decrement right--. This guarantees that each pair is swapped exactly once.
  • The algorithm works in-place (no extra large buffers) and uses O(1) additional memory. Time complexity is O(n) because each element is swapped at most once.
  • Edge cases: if n <= 1, the function immediately returns since no changes are needed. For very large n, consider using dynamic allocation instead of VLA for portability.
  • Advantages of this approach: simplicity, efficiency, and low memory usage. Useful when you need to quickly reverse the order of elements.

Extension (optional): Write a version that returns a newly allocated reversed array (does not modify the original), or a generic function that reverses an array of type void* using a swap function (useful for other data types).


Previous
​|< Two dimensional arrays in C/C++ - examples
Next
Algorithms examples >|

Algoritmi
Matrice
Java
Linkovi
​Politika Privatnosti
Kontakt



© 2025 by Slobodan svetprogramiranja.com

Sva prava zadržana

  • Home
  • WEB APPLICATIONS
    • Popular programming languages today
    • Programming trends
    • Internet of things
    • Creating web application
    • Frontend and backend programming
    • Creating Simple Website >
      • Create Your Logo Home
      • Create Your Logo CSS
    • Creating python web application >
      • Creating a Django Web Application - Getting Started
    • ASP.NET CORE web application >
      • ASP.NET CORE web application introduce >
      • Servicing static web pages using a web server
      • Creation of a sql web api service that reads data from the database
      • Creating a controller in an asp.net web API application
      • Communication of the Javascript web application with the API server
  • Algorithms
    • Algorithms Guide
    • Mathematical algorithms >
      • Array of Fibonacci
      • A prime numbers and factoring
      • Eratosthenes sieve
      • The Euclidean algorithm
      • The maximum sum of subarrays
      • Fast exponentiation algorithm
    • Structures and Unions >
      • Introduction to structures and unions
      • Disjoint Set Union (DSU) structures
      • Basic data structures
    • Sorting arrays
      • Merge-sort
      • Quick-sort
    • Binary search
    • Recursion and dynamic programming >
      • Recursive algorithms
        • Tower of Hanoi algorithm
      • Introduction to dynamic programming
      • DP: Fibonacci with memoization
      • DP: Knapsack problem – Explanation and examples
      • Longest Common Subsequence (LCS)
    • Graphs and Trees >
    • Advanced techniques >
      • Greedy Algorithms
  • Examples in C,C++,Java
    • Basic Examples >
      • Data examples in C/C++
      • Selection statements in C/C++ - examples
      • Loops in C/C++ examples >
        • Loops in C/C++ examples basic
        • Nested loops in c and c++ examples
      • Arrays in C/C++ examples
      • Strings in C/C++ examples
      • Sorting arrays in C/C++ examples
      • Two dimensional arrays in C/C++ - examples
      • Functions in C/C++ - examples
      • Algorithms examples >
        • Recursive algorithms examples
    • Additional examples with solutions >
      • Data in C - additional
      • Selection statements - additional
      • Loop - additional
      • Clasess and objects- additional
    • Preparations for competitions in informatics >
      • Preparations for qualifications for distict competitions
      • Qualifications for distict competitions
      • Preparation for the national competition
    • Tests >
      • Test from "Selections statements"
  • Programming languagages
    • Learn C >
      • Introducing to C
      • Basics about C
      • Data in languages C
      • Data in C
      • Operators in C
      • Selection Statements in C
      • Loops in C >
        • Loops in C basic
        • Nested loops in c
      • Arrays in c >
        • Onedimensional Array in c basic
        • Two-dimensional array-matrix in c
      • Strings in C
      • Two-dimensional arrays
      • Pointers in C
      • Functions in C
    • learn C++ >
      • Introducing to C++
      • Data in C++
      • Operators in C++
      • Selection Statements in C++
      • Loops in C++ >
        • Loops in C++ basic
        • Nested loops in c++
      • Arrays in c++ >
        • Introduction to an Array in c++
        • Vectors in c++
        • Two-dimensional array-matrix in c++
        • Maps in c++
        • Two dimensional dynamic arrays in c++
      • Strings in C++
      • Pointers in C++
      • Functions in C++
    • Learn JAVA >
      • Introducing to JAVA
      • Java Basic >
        • Data in JAVA programming
        • Selections statements in JAVA
        • Operators in JAVA
        • Loops in JAVA
        • Arrays in JAVA
      • Object oriented programming >
        • Understanding Java as an Object-Oriented Language
        • Classes and Objects
        • Inheritance of classes
        • Abstract classes and interfaces
        • The visual part of the application >
          • Graphical user interface
          • Events in Java
          • Drawing in window
          • Graphics in JAVA-example
          • Animations in JAVA-examples
          • Applications in JAVA-examples
      • Distance learning java
    • Learn Processing >
      • Intoduction to processing
      • Basic of processing using JAVA
      • Processing and microbit
      • Using vectors in Processing >
        • Vector operations application
      • Processing 2D >
        • Creating Projectile motion animation
        • Processing example: Soccer game shoot
        • Body sliding down a inclined plane
        • Analisys of an inclined plane
        • Circular motion animation in processing
      • Processing 3D >
        • Introducing to 3D processing
        • Movement of 3D objects in processing
    • Arduino and ESP32 programming >
      • Learn Arduino Programming >
        • Intoduction to arduino
        • LDR sensor(light sensor) exercises
        • Arduino temperature sensor - exercises
        • Measuring an unknown resistor
        • Arduino -Ultrasonic sensor
        • Introduction to servo-motors on arduino
        • Moisture soil sensor
      • Learn ESP32 Programming >
        • Intoduction to ESP32
        • ESP32 with servo motors exercise
  • MORE
    • Privacy Policy
    • Links
    • Distance learning
SVET PROGRAMIRANJA

Podešavanja kolačića

Koristimo kolačiće da bismo vam pružili najbolje moguće iskustvo. Takođe nam omogućavaju da analiziramo ponašanje korisnika kako bismo stalno poboljšavali veb lokaciju za vas.

  • Početna
  • WEB APLIKACIJE
    • Web programiranje vodič
    • Osnove Web-a >
      • Uvod u WEB
      • Web server
      • Frontend i Backend
      • Šta je API u programiranju
      • Backend izbor
    • Kreiranje web sajtova i web aplikacija >
      • Kreiranje web sajta osnove >
        • Kreiranje web sajta
        • Logo Kreator - naslovna
        • Klase za stil naslovne strane
      • Kreiranje Django Web Aplikacije >
        • Python Web Aplikacije
        • Kako Python radi na serveru
        • Kreiranje Python Web Aplikacije-početak
        • Kreiranje aplikacije na Heroku Web Platformi 2
        • Logo Kreator - Kreiranje Naslovne strane
        • Django aplikacija i baza podataka
        • Kreiranje aplikacije na Heroku Web Platformi >
          • Dodavanje modula za registraciju >
            • Dodavanje web strane za logovanje
      • ASP.NET Core web aplikacije >
        • ASP.NET Core web aplikacije uvod
        • Servisiranje statičkih web strana pomoću web servera
        • Kreiranje sql web api servisa koji čita podatke iz baze
        • Kreiranje kontrolera u asp.net web API aplikaciji
        • Komunikacija Javascript web aplikacije sa API serverom
  • Učenje programiranja
    • Algoritmi >
      • Algoritmi početna - Učenje i Primeri
      • Matematički algoritmi >
        • Fibonačijev niz
        • Prosti brojevi i faktorizacija
        • Eratostenovo sito
        • Euklidov algoritam
        • Maksimalna suma podniza
        • Brzo stepenovanje
      • Strukture podataka >
        • Mapa učenja Strukture podataka
        • Uvod u strukture i unije
        • Uvod u vektore
        • Povezane liste
        • Stek (Stack)
        • Red(Queue)
        • Disjoint Set Union (DSU) strukture+
        • Osnovne strukture podataka
      • Sortiranje nizova >
        • Sortiranje objedinjavanjem
        • Brzo Sortiranje
      • Binarna pretraga
      • Rekurzija i dinamičko programiranje >
        • Rekurzivni algoritmi >
          • Hanojske kule
        • Uvod u dinamičko programiranje
        • Fibonacijev niz DP i memoizacija – objašnjenje i primeri
        • Osnovni DP obrasci >
          • DP: Problem ranca (Knapsack problem)
          • DP: Najduži zajednički podniz (LCS)
          • DP: Subset Sum -problem podskupa sa zadatom sumom
        • Napredni DP obrasci >
          • DP: Minimalan broj kovanica
          • Grid DP problem
          • Edit Distance DP
      • Zamena iteracija formulom
      • Grafovi i stabla >
        • Mapa učenja — Grafovi i stabla
        • Osnove i pretrage >
          • BFS i DFS (pretraga grafova)
          • Topološko sortiranje
          • Otkrivanje ciklusa u usmerenim grafovima
          • Najduži put u DAG-u (DP + topološko sortiranje)
        • Najkraći putevi >
          • Algoritmi grafovi Dijkstra-najkraći put
          • Bellman-Ford i Floyd-Warshall algoritmi
        • Minimalna stabla >
          • MST - Primov algoritam
          • Grafovi MST - Kruskalov algoritam
        • Grafovi Napredno >
          • Eulerovi putevi i ciklusi
          • Mostovi i Artikulisani čvorovi (Tarjanov algoritam)
          • SCC — Komponente jake povezanosti (Kosaraju i Tarjan)
          • DP na DAG-ovima — Primene
      • Napredne tehnike >
        • Podeli pa vladaj
        • Gramzivi algoritmi
    • Primeri - C,C++,Java,Python >
      • Primeri iz programiranja – C, C++, Java, Python | Svet Programiranja
      • Osnovni primeri >
        • Podaci-primeri
        • Operatori-primeri
        • Grananje u programu - primeri
        • Petlje primeri >
          • Petlje - osnovni primeri
          • Ugnježdene petlje primeri
        • Stringovi - primeri
        • Nizovi primeri >
          • Nizovi-primeri
          • Sortiranje-primeri
          • Vektori i mape primeri
        • Matrice primeri
        • Funkcije u C/C++ jeziku -primeri
        • Primeri Algoritama >
          • Algoritmi-primeri >
            • Zamena iteracija formulom-primeri >
              • Nedostajući broj-uputstvo
          • Rekurzija-primeri >
            • Prvi i drugi na rang listi
          • Kombinatorika-primeri
          • Bektreking i gruba sila primeri
      • Dodatni primeri sa rešenjima >
        • Dodatni primeri sa rešenjima – algoritmi, petlje, grananje, OOP
        • Podaci i tipovi podataka-dodatni primeri
        • Dodatni primeri za vezbu - grananje u programu
        • Dodatni primeri iz petlji
        • Dodatni primeri za vezbu - Klase i objekti >
          • Ramovi za slike objekti-rešenje
          • Zadatak 2-Grupa radnika objekti
          • Salon Automobila rešenje
          • Zadatak 3. Kretanje automobila objekti-rešenje
          • Upravljanje porudžbinama u restoranu -rešenje zadatka
        • Kombinovani primeri za vezbu >
          • Zadatak 6-Interval-rešenje
      • Takmičenja-primeri >
        • Takmičenja primeri - vodič
        • Priprema za okružna takmičenja 1
        • Priprema za okružna takmičenja 2
        • Kvalifikacije za okružna takmičenja >
          • Datum sa najvećom zaradom-rešenje
          • Zbirovi nakon podele - rešenje
          • Zadatak Mešalica-rešenje
          • Zadatak Kuvar Rešenje
          • Zadatak Slovarica rešenje
          • Zadatak Note rešenje
          • Resenje zadatka Tačan Izraz
          • Zadatak Puž rešenje
          • Zadatak Seča Drva-rešenje
        • Opštinska takmičenja >
          • Zadatak Bejzbol Rešenje
        • Okružna takmičenja >
          • Zadatak Milioner rešenje
          • Zadatak Dve Slike Na Papiru
        • Priprema za državna takmičenja
        • Priprema za više nivoe takmičenja >
          • Priprema za drzavno takmičenje i SIO >
            • Zadatak Aritmetički trougao-rešenje
            • Obilazak konja-zadatak
            • Reči u mreži zadtak-rešenje
          • Interaktivni Algoritmi >
            • Zadatak Joker rešenje
            • Zadatak Boja rešenje
            • Zadatak Maksimizacija BTC
      • Objektno programiranje-primeri >
        • Klase i objekti - primeri
      • Testovi >
        • Testovi i kontrolni zadaci — vežbanje, mini-testovi i priprema
        • Kontrolni podaci
        • Kontrolni selekcije
        • Kontrolni petlje
        • Kontrolni - objekti i metode
        • Kontrolni Nizovi
  • Programski jezici
    • Programski jezici vodič
    • C >
      • C programski jezik
      • Uvod u programski jezik C
      • Elementi jezika C
      • Podaci u C jeziku
      • Operatori u C jeziku
      • Grananje u programu u C jeziku
      • Petlje u C programskom jeziku >
        • Petlje u programskom jeziku C
        • Ugnježdene petlje u C
      • Nizovi u jeziku C >
        • Nizovi u jeziku C
        • Dvodimenzionalni nizovi - matrice
        • Dvodimenzioni dinamički nizovi-matrice
      • C Stringovi
      • Pokazivači u C jeziku
      • Funkcije u C
    • C++ >
      • C++ programski jezik
      • Uvod u programski jezik C++
      • Podaci u C++ jeziku
      • Operatori u C++ jeziku
      • Grananje u programu u C++
      • Petlje u C++ programskom jeziku >
        • Petlje u programskom jeziku C++
        • Ugnježdene petlje u C++
      • Nizovi u C++ jeziku >
        • Nizovi u jeziku C++
        • Dinamički niz-vector
        • Rečnik podataka-mape u C++
        • Dvodimenzionalni nizovi - matrice u c++
        • Dvodimenzioni dinamički nizovi u c++
      • Stringovi u C++ jeziku
      • Pokazivači u C++
      • Funkcije u C++
    • C# >
      • C# – lekcije, primeri i vežbe
      • Uvod u C#
      • Kreiranje jednostavne aplikacije u C#
      • LINQ i Lambda izrazi u C#(Sharp)-u
      • Napredni C#(Sharp) primer
      • Konekcija sa bazom u C#-primer
      • Primer sa MySql bazom podataka
      • Kreiranje Windows Form App Sa SQLServer Bazom
    • JAVA >
      • Java – lekcije, primeri i zadaci
      • Uvod u Javu
      • Java osnove >
        • Podaci u JAVA programskom jeziku
        • Operatori u JAVI
        • Grananje u programu u programskom jeziku Java
        • Petlje u Javi
        • Nizovi u Javi
      • Objektno programiranje >
        • Klase i objekti
        • Metode i objekti
        • Nasleđivanje klasa
        • Apstraktne klase i interfejsi
      • Grafika u JAVI >
        • Grafika u Javi uvod
        • Grafički korisnički interfejs(GUI)
        • Događaji u JAVI
        • Crtanje u prozoru
        • Animacije u Javi-primer
        • Kreiranje 2D igrice u JAVI
        • Grafika u Javi-primer
        • Aplikacije u Javi-primeri
      • Simulacije u fizici >
        • Java i simulacije u fizici
        • Klase i objekti sa primenom u fizici
        • Upotreba ciklusa i nizova u simulacijama iz fizike
        • Primeri simulacija u EJS-u
    • Processing >
      • Processing – lekcije i primeri
      • Processing - uvod
      • Osnove processinga sa Javom
      • Processing i mikrobit
      • Vektori u Processing-u >
        • Opracije sa vektorima
      • Processing u 2D >
        • Kosi hitac u Processing-u
        • Primer kosog hica u processingu
        • Strma ravan u Processing-u
        • Analiza klizanja tela niz strmu ravan primer
        • Animacija Kružnog kretanja
      • Processing u 3D >
        • Uvod u 3D processing
        • Kretanje 3D objekata u processing-u
    • Arduino i ESP32 programiranje >
      • Arduino i ESP32 programiranje
      • Arduino programiranje >
        • Arduino Uno – Uvod
        • Arduino LDR Vežba-Prikaz osvetljenja
        • Arduino senzor temperature
        • DC motor-Upravljanje sa arduinom
      • ESP32 programiranje >
        • Uvod u ESP32
        • ESP32: Ultrazvučni senzor
        • ESP32-Primena kod servo motora
        • ESP32 Pokretanje pumpe za vodu
    • Python >
      • Uvod u python
      • Zašto učiti Python
      • Osnovni Python >
        • Python Osnovni Tutorijal — Početna za lekcije i primere
        • Python osnove >
          • Python za početnike – Instalacija i Prvi Program
          • Prvi program u python-u
          • Aritmetičke operacije u python-u
          • Mini projekti za početnike
          • Promenljive i tipovi podataka
          • Python input() — unos podataka za početnike
          • Formatiranje teksta-F string
          • Mini projekat-python
        • Kontrola toka programa >
          • Python grananje i logički operatori — if / elif / else
          • Grananje u Pythonu — if, elif, else | Svet Programiranjai
          • Mini zadaci- Temperatura i kviz
          • Petlje - while,for
          • Iteracije i osnovni algoritmi u Python-u
          • Mini zadaci — Petlje (for i while)
          • Nizovi i liste u python-u
          • Mini projekat: igra „Pogodi broj“
        • Funkcije i modularno programiranje >
          • Python funkcije
          • Python parametri i povratne vrednosti
          • Python opseg promenljivih
          • Modularno programiranje- moduli i import
        • Mini projekti i praktične vežbe >
          • Projekat: Pogodi broj
          • Mini projekat: Organizacija programa u module
          • Mini projekat — Brojač bodova i statistika
          • Mini projekat — Tekstualni meni
          • Mini projekat — Simulacija semafora
          • Završni mini projekat — Digitalni brojač
      • MycroPython(microbit) >
        • Micro:bit — MicroPython
        • Osnove programiranja (MicroPython) >
          • Uvod i osnovni programi >
            • Uvod u micropython
            • MicroPython: LED matrica — prikaz teksta i slika na micro:bit-u
            • MicroPython — Dugmad
          • MicroPython — Petlje i vreme
          • MicroPython – promenljive i funkcije
          • MicroPython – random i algoritmi
        • Senzori i ulazi >
          • MicroPython — Senzori
          • MicroPython: kompas i temperatura
          • MicroPython – dodatni senzori i aktuatori
        • Komunikacije i Projekti >
          • MicroPython: radio komunikacija
          • MicroPython: radio projekti
          • MicroPython: mini projekti
          • MicroPython – serial i Processing
      • Python + Processing >
        • Python i processing početna
        • Osnova i okruženje >
          • Python i Processing — uvod
          • Instalacija Processing 4
          • Prvi sketch — crtanje
        • Crtanje i grafika >
          • Oblici i boje i rad sa slikama
        • Animacija i interakcija >
          • Animacija i promenljive
          • Interakcija (miš i tastatura)
        • Mini projekti - igre >
          • Mini projekat: Pong
          • Pong u Pythonu — Score i Game Over
          • Pong sa 2 Igrača u Pythonu — Processing
          • Pong OOP u Pythonu — Modularna igra
          • Nizovi i liste — Python Processing
        • Vizuelizacija i projekti >
          • Crtanje grafikona — Python Processing
          • Interaktivni grafikon — Python Processing
        • Kreativni i takmičarski projekti >
          • Generativna umetnost
          • Projekti za takmičenja
          • Izvoz i prezentacija
      • Python za web >
        • Python web programiranje
        • Uvod u Python web >
          • Uvod u Python web programiranje
          • HTTP protokol i web komunikacija
          • Klijent server model u web aplikacijama
        • Uvod u Flask >
          • Python Flask uvod
          • Prva Flask web aplikacija
          • Flask rute u Pythonu
          • Flask rute i HTML template
        • Django framework >
          • Django uvod
          • Kreiranje Django projekta
          • Django modeli i baza podataka
          • Django forme i registracija korisnika
          • Django web aplikacija
          • Postavljanje Django aplikacije na server
          • Python web projekti za početnike
      • Projekti >
        • Python projekti
        • Početnički projekti >
          • Python kalkulator projekat
          • Python projekat – Pogodi broj
          • Python generator lozinki
          • Program za nasumične citate u Pythonu
        • Projekti sa podacima >
          • Analiza CSV fajlova u Pythonu
          • Python projekat – Program za osnovnu statistiku
          • Vizualizacija podataka u Python-u
        • Grafički Projekti >
          • Pong igra u Processing Python modu
          • Generativna grafika u Pythonu
        • Web Projekti >
          • To-Do web aplikacija u Flask frameworku
          • Django blog aplikacija
          • Python Flask REST API projekat
        • Napredni Projekti >
          • Python chat server
          • Python REST API
          • Python modularni projekat
    • Mikrobit i programiranje >
      • Microbit – Učenje programiranja za osnovce
      • Programiranje mikrobita snove >
        • Uvod u mikrobit
        • Naredbe u Makecode-u
        • Palete komandi Variables, Led. Temperatura i osvetljenje
        • Radio veza na mikrobitu
        • Upotreba promjenljivih i kontrolnih naredbi u programima
        • Kontrolne naredbe u programima mikrobita
        • Petlje-mikrobit
      • Programiranje mikrobita napredno >
        • Igrice i mikrobit
        • Mikrobit projekti i radionice
  • Resursi
    • Trendovi u programiranju
    • Učenje na daljinu >
      • Učenje na daljinu-osnovci takmicari
    • Internet stvari
    • Linkovi
  • Kontakt