-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbar2.c
More file actions
54 lines (37 loc) · 614 Bytes
/
bar2.c
File metadata and controls
54 lines (37 loc) · 614 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
Program for
Written by: Alec
Wirrten on: Oct 2018
Written in: C
Compilied with: gcc
Version 1.0.0
*/
#include <stdio.h>
#include <math.h>
int main(void){
//Defines variables
int count = 0;
int n = number;
//Ask user for input and reads it
printf("Enter the 12 digit barcode: \n");
scanf("%i", &n);
//Determines length of number
while (n != 0)
{
n /= 10;
cout++;
}
//Puts digits of number into array
if(count!=0){
int numberArray[count];
count = 0;
n = number;
while (n != 0){
numberArray[count] = n % 10;
n /= 10;
count++;
}
return 0;
}
return 0;
}