It's a basic algorithm that i got half way through.
Write an algorithm that for an entered number from 100 to 10,000 prints if the number has 3, 4 or 5 numbers (Ex. 100, 1000 or 10000)
Algorithm: Proizvod
Start
Read: proizvod, m, n
??? <- 12
proizvod <- 1
While m (Is equal or smaller than) n execute (извршувај)
proizvod (производ) = proizvod + n
What do i do now? Sorry if i didn't translate it well.
#include <stdio.h>
int main(void)
{
int n;
printf("Enter a number from 100 to 10000:\n");
scanf("%d", &n);
if (n >= 100 && n <= 10000) {
if (n >= 100 && n <= 999)
printf("\nThe number has 3 digits\n");
else if (n >= 1000 && n <= 9999)
printf("\nThe number has 4 digits\n");
else if (n = 10000)
printf("\nThe number has 5 digits\n");
} else
printf("\nAre you fucking retarded? I said between 100 and 10000!\n");