Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Lab 9 v0.6
//gcc 5.4.0 #include <stdio.h> int main(void){ int n=4; int cu=0; int cut=0; int ci=0; int cit=0; char A[4]={'a','b','c','d'}; char B[4]={'c','d','e','f'}; //strlen(A); //strlen(B); char U[30]; char I[30]; for(int i=0;i<=n;i++){ for(int j=0;j<=n;j++){ if(A[i]==B[j]){ I[ci]=A[i]; ci++; // printf("ci=%d I[%d]=%c\n",ci,ci,I[cu]); } } } //for(int p=0;p<=n;p++){ // U[p]=A[p]; // cu++; // printf("cu=%d U[%d]=%c\n",cu,cu,U[cu]); // } for(int o=0;o<=n;o++){ U[cu+o]=B[0]; } cut=cu-1; for(int l=0;l<=cut;l++) printf("U[%d]=%c\n",l,I[l]); cit=ci-1; for(int k=0;k<=cit;k++) printf("I[%d]=%c\n",k,I[k]); }
run
|
edit
|
history
|
help
0
Class #2, data types
sample
finalpyramid
EXercice
#Define / Case/ If practice
Sunday assignment late v3
est
Midterm practice 2
Absolute valu
18BCE2182 ASSESS_1 Q2-1