i am getting error anyone can help | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

i am getting error anyone can help

#include <stdio.h> #include <stdio.h> int main () { char dictionary [10] [2][15]={ "Baum", "Tree", "Fahne", "Flag", "Tisch", "Table", "Stuhl" "Chair", "Essen", "To Eat", "Kopf", "Head", "Fernseher", "TV", "Sonnig", "Sunny", "Schon", "Beautiful", "Schule", "School", } char german[15]; printf ("Enter a german word :") ; gets (german); int i, c=0; for (i = 0; i < 10;i++) { if(strcmp (german, dictionary[i] [0])==0) { printf("English - %s\n",dictionary [i] [1]); } else c++; } if (c==10) printf("Not in Dictionary. !"); return 0; }

8th Apr 2020, 6:04 AM
AsentjaX👨🏾‍💻
5 Respuestas
+ 1
Muhudin M Alasow ✌️ you should include string.h as you're using strcmp, a comma between "Stuhl" and "Chair" a semicolon after the dictionary declaration
8th Apr 2020, 7:01 AM
John Robotane
John Robotane - avatar
0
Hei
9th Apr 2020, 12:55 PM
AsentjaX👨🏾‍💻
0
// C program to find a pair with the given difference #include <stdio.h> // The function assumes that the array is sorted bool findPair(int arr[], int size, int n) { // Initialize positions of two elements int i = 0; int j = 1; // Search for a pair while (i<size && j<size) { if (i != j && arr[j]-arr[i] == n) { printf("Pair Found: (%d, %d)", arr[i], arr[j]); return true; } else if (arr[j]-arr[i] < n) j++; else i++; } printf("No such pair"); return false; } // Driver program to test above function int main() { int arr[] = {1, 8, 30, 40, 100}; int size = sizeof(arr)/sizeof(arr[0]); int n = 60; findPair(arr, size, n); return 0; }
9th Apr 2020, 12:55 PM
AsentjaX👨🏾‍💻
0
I am just a beginner
9th Apr 2020, 12:58 PM
AsentjaX👨🏾‍💻
0
If you please check it
9th Apr 2020, 12:58 PM
AsentjaX👨🏾‍💻