Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Lab 9 v0.95
//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 g=0;g<n+m;g++){ if(g<n){ U[c]=A[ca]; printf("U[%d]=%c\n",c,U[c]); ca++; c++; } else if(g>=n){ for(int d;d<n+m;d++){ if(B[cb]!=A[d]){ U[c]=B[cb]; printf("U[%d]=%c\n",c,U[c]); cb++; c++; } else{ cb++; } } } } printf("\n\n"); 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"); }
run
|
edit
|
history
|
help
0
1.2 No. of Threads
C pattern Rhombus
Maximum
Arrays
joseph a triangle
UserDefinedDataType_pointer1
CALCULADORA
Finding the second largets value v0.5
Different variable scanf/printf statements
1