Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
DUE TUESDAY
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
2 for loops i and j control the loops and do not go ++i or ++j, know when you are going to move C Program that takes two arrays 1,4,6,9,15 2,5,8,10 Merge these two arrays in new array Merged array is in ascending order Size n and size m and new array has size n+m point to the first index of both, compare which is bigger and which is smaller fill array with smallest then biggest in those two spots Initialize the arrays array1 and array2 and set the values find size of array1 and array 2 and set value to n and m initialize array3 o=n+m set size of array3 to o have an i statement but no incrementing in the for loop statement itself, plan to have ++i and ++j only when the /* #include <stdio.h> int main(void) { int found = 0, index; int mat[]={10,12,20,25,13,10,9,40,60,5}; for (int i = 0; i<10;i++) { if(mat[i]==5) { found = 1; index = i; } } if(found == 1) printf("The index is %d",index); else printf("Element not found"); return 0; }*/ /* #include <stdio.h> int main(void) { int n = 3; int array[3][3] ={{4,5,3},{0,1,2},{11,12,10}}; for(int x=0;x<n;x++){ printf("{ "); for(int y=0;y<n;y++){ if (array[x][y]%2==0){ array[x][y]=0; } else if (array[x][y]%2!=0){ array[x][y]=1; } printf("%d ", array[x][y]); } printf("}\n"); } } */ /* #include <stdio.h> #define m 3 #define n 3 #define o 3 int main(){ int i, j, k; int arr[3][3][3]= { { {11, 12, 13}, {14, 15, 16}, {17, 18, 19} }, { {21, 22, 23}, {24, 25, 26}, {27, 28, 29} }, { {31, 32, 33}, {34, 35, 36}, {37, 38, 39} }, }; for (int i=0; i<m; i++){ for (int j=0; j<n; j++);{ for (int k=0; k<o; k++);{ printf("Value for array[%d][%d][%d] = %d\n", i, j, k, arr[i][j][k]); } } } return 0; } */
gcc
Show compiler warnings
[
+
] Compiler args
[
+
]
Show input
Compilation time: 0.14 sec, absolute running time: 0.41 sec, cpu time: 0.33 sec, memory peak: 3 Mb, absolute service time: 0,55 sec
edit mode
|
history
|
discussion
The index is 9