Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

tekalj / iax0583

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Commit 372958ac authored 6 years ago by tekalj's avatar tekalj
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

2. praktikum

parent 48d3375b master
Hide whitespace changes
Inline Side-by-side
Showing with 92 additions and 0 deletions
  • firstprogram
  • firstprogram.c
  • firstprogram.o
  • secondwork
  • secondwork.c
firstprogram 0 → 100644
View file @ 372958ac
File added
This diff is collapsed. Click to expand it.
firstprogram.c 0 → 100644
View file @ 372958ac
#include <stdio.h>
int main(){
char name[100]; //this is an array of 100 characters
int code; //this is an integer
printf("please input your name");
scanf("%s", name);
printf("please input your student code");
scanf("%d", &code);
if( (code > 99999) && (code > 1000000) ){
printf("hello! and welcome to coding %s, %d", name, code);
}else{
printf("nice try buster, but I don't think you've got a code");
}
return 0;
}
This diff is collapsed. Click to expand it.
firstprogram.o 0 → 100644
View file @ 372958ac
File added
This diff is collapsed. Click to expand it.
secondwork 0 → 100644
View file @ 372958ac
File added
This diff is collapsed. Click to expand it.
secondwork.c 0 → 100644
View file @ 372958ac
#include <stdio.h>
int main () {
int thisIsAnArray[10];
int i = 0;
while(i < 10) {
printf("please insert number %d ", i+1 );
scanf("%i", &thisIsAnArray[i]);
i++;
}
int maxValue = thisIsAnArray[0];
i=1;
while(i < 10){
if (thisIsAnArray[i] > maxValue){
maxValue = thisIsAnArray[i];
}
i++;
}
printf("%d", maxValue);
return 0;
}
/**
int main() {
int array[10] = {15, 6, 98, -8, 65, -777, -87, 213, 5};
int i = 0;
int max = array[0];
while (i<9){
if (max < array[i+1]) {
max = array[i+1];
}
i = i+1;
}
printf("%d is largest number", max);
return 0;
}
int main() {
int array[10] = {15, 6, 98, -8, 65, -777, -87, 213, 5};
int i = 0;
int min = array[0];
while (i<9){
if (min > array[i+1]) {
min = array[i+1];
}
i = i+1;
}
printf("%d is smallest number", min);
return 0;
}
**/
This diff is collapsed. Click to expand it.
  • Write
  • Preview
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment