100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Summary

Samenvatting Voorbeelden C

Rating
2.0
(1)
Sold
10
Pages
23
Uploaded on
03-08-2020
Written in
2019/2020

Voorbeelden uit de les van C Programmeren C en C plus plus Industrieel ingenieur - informatica

Institution
Course










Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Study
Course

Document information

Uploaded on
August 3, 2020
Number of pages
23
Written in
2019/2020
Type
Summary

Subjects

Content preview

Hoofdstuk 1
Aanwezigheidstabel
#include<stdio.h>
#include<stdbool.h>


#define MAXSCORE 20


int main() {
int score, i;


/* aanwezigheidstabel declareren en initialiseren */
bool aanwtabel[MAXSCORE + 1] = {false};


/* scores inlezen en aanduiden in de aanwezigheidstabel */
while (scanf("%d",&score))
aanwtabel[score] = true;


/* overzicht van de scores weergeven */
printf("Volgende scores komen niet voor:\n");
for (i = 0; i <= MAXSCORE; i++)
if (!aanwtabel[i])
printf("%d ",i);
}



Eerste
#include <stdio.h> /* standard I/O */


int main() {
printf("\"If at first you don't succeed,\n");
printf("try, try, try again!\"");
return 0;
}




1

,Arrays 1
#include <stdio.h>
#define MAX 5


int main() {
int i;


/* array declareren en uitschrijven */
int getallen[MAX];
printf("Grootte array: %d\n", sizeof(getallen)/sizeof(int));
printf("Array gedeclareerd, maar geen waarde toegekend:\n");
for (i=0 ; i<MAX ; i++)
printf("%d ", getallen[i]);
printf("\n");


/* array opvullen */
for (i=0 ; i<MAX ; i++)
getallen[i] = i;


/* array uitschrijven */
printf("Opgevulde array:\n");
for (i=0 ; i<MAX ; i++)
printf("%d ", getallen[i]);
printf("\nBuiten tabel lezen: %d %d %d %d",
getallen[MAX],getallen[MAX+1],
getallen[MAX+2],getallen[MAX+3]);
return 0;
}



GetChar
#include <stdio.h>
#include <ctype.h>
/* om te kunnen gebruik maken van de functie toupper */


int main() {
char c;
while ((c = getchar()) != EOF) {
putchar(toupper(c));
}



/* oefening:
herschrijf dit programma zonder gebruik te maken
van functies uit ctype.h
*/
return 0;
}


2

, Arrays 2
#include <stdio.h>


void verdubbel(int[], int);


int main() {
int i, n;
int t[] = {1,2,3,4,5};
n = sizeof(t)/sizeof(t[0]);
verdubbel(t,n);
for (i=0 ; i<n ; i++)
printf("%d ",t[i]);
return 0;
}


void verdubbel(int t[], int n) {
int i;
for(i=0 ; i<n ; i++)
t[i] *= 2;
}



Arrays 3
#include <stdio.h>


void kopieer(const int[], int[], int);

int main() {
int a[] = {1,2,3,4,5};
int b[5];
int i;
for (i=0 ; i<5 ; i++)
printf("%d ", b[i]);
printf("\n");
kopieer(a,b,5);
for (i=0 ; i<5 ; i++)
printf("%d ", b[i]);
return 0;
}


void kopieer(const int s[], int d[], int n) {
int i;
for(i=0 ; i<n ; i++) {
d[i] = s[i];
/* s[i] = d[i]; */
}

3
Free
Get access to the full document:
Download

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached


Also available in package deal

Reviews from verified buyers

Showing all reviews
4 year ago

4 year ago

Hello! Could you be a little clearer what's not right? Are the examples no longer up to date? Thanks in advance mvg

2.0

1 reviews

5
0
4
0
3
0
2
1
1
0
Trustworthy reviews on Stuvia

All reviews are made by real Stuvia users after verified purchases.

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
stephaniepicard Universiteit Gent
Follow You need to be logged in order to follow users or courses
Sold
423
Member since
8 year
Number of followers
230
Documents
18
Last sold
1 week ago
Industrieel ingenieur - UGENT

Hallo! Ik studeer industrieel ingenieur informatica aan de Universiteit Gent. Ik help graag anderen door mijn samenvattingen te delen. Hierbij vind ik het heel belangrijk dat mijn samenvattingen in orde zijn. Als er dus opmerkingen of vragen zijn, beantwoord ik deze graag! Indien je graag wilt dat ik nog andere zaken deel (oefeningen, formularia,...) mag je altijd een berichtje sturen. Aarzel dus niet om mij te contacteren. Ik wens je alvast goede resultaten. MVG Stéphanie

Read more Read less
4.4

67 reviews

5
35
4
25
3
5
2
2
1
0

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions