Skip to content
Snippets Groups Projects
Commit 455c54ba authored by Baruta Daniel Mihail's avatar Baruta Daniel Mihail
Browse files

Add readme

parent bea36442
No related branches found
No related tags found
No related merge requests found
# Perfect assignment
Write a program that given a number as input argument prints the corespondig number of 1s on standard output.
E.g:
```bash
$> ./binary 3
1 1 1
```
......@@ -3,16 +3,5 @@
int main(int argc, char **argv)
{
if (argc != 2) {
fprintf(stderr, "Not enough arguments!\n");
return 1;
}
int number = atoi(argv[1]);
for (int i = 0; i < number; i++)
printf("1 ");
printf("\n");
return 0;
}
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
if (argc != 2) {
fprintf(stderr, "Not enough arguments!\n");
return 1;
}
int number = atoi(argv[1]);
for (int i = 0; i < number; i++)
printf("1 ");
printf("\n");
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment