• Forums
  • View New Posts
  • View Today's Posts
  • Search
  • Members
  • Calendar
  • Help
  • Extras
Forum stats
Show team
View New Posts
View Today's Posts
Lowlands Tactical: Forum
Login to account Create an account
Login
Username/Email:
Password: Lost Password?
 

  Lowlands Tactical: Forum Publiek Speeltuin
1 2 Next »
De grote programmeer opdracht 2016!

Thread Modes
De grote programmeer opdracht 2016!
Sacha Offline
Administrator
*******
Posts: 1,305
Threads: 266
Joined: Aug 2014
Reputation: 7
#5
08-10-2016, 07:31 PM
PHP Code:
#include <stdlib.h>
#include <stdio.h>
#include <time.h>

int main()
{
  
int myArray[10];
  
int urArray[10];
  
int i, j;
  
time_t t;

  
/* Seed with me */
  
srand((unsigned) time(&t));

  for (
i=0;i<10;i++) {
    
myArray[ i ] = rand() % 100;
  }

  for (
i=0;i<10;i++) {
    
urArray[i] = myArray[i];
  }

  
myArray[9] = -7;

  
printf("1st Array: ");
  for (
j=0;j<10;j++) {
    
printf("%d ",myArray[j]);
  }
  
printf("\n");

  
printf("2nd Array: ");
  for (
j=0;j<10;j++) {
    
printf("%d ",urArray[j]);
  }
  
printf("\n");

} 

Code:
$ ./a.out
1st Array: 39 63 41 96 97 47 79 45 30 -7
2nd Array: 39 63 41 96 97 47 79 45 30 31
Website Find
Reply
Share Thread:            


Messages In This Thread
De grote programmeer opdracht 2016! - Sacha - 08-10-2016, 03:13 PM
RE: De grote programmeer opdracht 2016! - Sacha - 08-10-2016, 03:15 PM
RE: De grote programmeer opdracht 2016! - PingWing - 08-10-2016, 03:44 PM
RE: De grote programmeer opdracht 2016! - Archu - 08-10-2016, 04:00 PM
RE: De grote programmeer opdracht 2016! - Sacha - 08-10-2016, 07:31 PM
RE: De grote programmeer opdracht 2016! - Sacha - 08-11-2016, 11:09 AM

  • View a Printable Version
  • Subscribe to this thread


Users browsing this thread:
1 Guest(s)

  • Contact Us
  • Forum team
  • Forum stats
  • Return to Top
 
  • RSS Syndication
  • Lite mode
  • Lowlands Tactical
  • Help
 
Forum software by © MyBB - Theme © iAndrew 2014



Linear Mode
Threaded Mode