Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Lab 9 v0.965
//gcc 5.4.0 #include <stdio.h> #include <string.h> int main(void){ int n=4; int m=4; int ca=0; int cb=0; int ci=0; int c=0; char A[4]={'a','b','c','d',}; char B[4]={'c','d','e','f',}; //char U[30]; char I[30]; //n=sizeof(A)/4; //m=sizeof(B)/4; char U[n+m]; printf("%d=n+m\n",n+m); for(int i=0;i<=n;i++){ for(int j=0;j<=n;j++){ if(A[i]==B[j]){ I[ci]=A[i]; printf("I[%d]=%c\n",ci,I[ci]); ci++; } } } printf("\n\n"); for(int g=0;g<n+m;g++){ if(g<n){ U[c]=A[ca]; printf("U[%d]=%c\n",c,U[c]); ca++; c++; } else{ for(int d=0;d<m;d++){ if(B[d]==I[d]){ cb++; } else{ U[c]=B[cb]; printf("U[%d]=%c\n",c,U[c]); cb++; c++; // printf("=cb%d\n",cb); } } } } printf("\n\n"); }
run
|
edit
|
history
|
help
0
extra causes class UK assisment
h
xd
sum of min and max
C/Assembly
Project 3 part 2 Book v10.2
Lab 9 v0.95
bitwise operations
Print Micro Seconds
Bitfield and Union in C - strange results