हेलो दोस्तों !
आज की इस Simple dictionary project in C language in Hindi पोस्ट में हम simple dictionary का project C language की मदद से बनाना सीखेंगे। तो दोस्तों अगर आप इस project को बनाना सीखना चाहते है तो इस पोस्ट को अंत तक जरूर पढ़े।
इस पोस्ट के मुख्य टॉपिक्स निन्म है -
- dictionary project overview.
- dictionary project source code.
- dictionary project video.
1.dictionary project overview :-
तो दोस्तों सबसे पहले हम dictionary project का overview देख लेते है की यह project क्या करेगा कैसे करेगा, कौन सा फंक्शन क्या करेगा।
दोस्तों अगर हम बात करें इस प्रोजेक्ट की तो यह एक सिंपल सा dictionary प्रोजेक्ट है। जिसमें पहले आपको words और उनके meanings को इस डिक्शनरी प्रोजेक्ट में ऐड करना होगा। इसके बाद अगर आप वर्ड को सर्च करते है तो वो वर्ड अगर डिक्शनरी में होगा तो उस वर्ड की meaning शो होगी। इस प्रोजेक्ट में आप वर्ड को सर्च और ऐड कर सकते है साथ में आप डिक्शनरी के सारे वर्ड्स को एक साथ स्क्रीन पर शो करा सकते है।
दोस्तों हमने इस प्रोजेक्ट में main फंक्शन के अलावा तीन यूजर डिफाइन फंक्शन्स को बनाया है जो निन्म है -
- search_word function
- add_word function
- show_dictionary function
main function :-
दोस्तों हमने main फंक्शन के अंदर dictionary के लिए मेनू को क्रिएट करने से रिलेटेड कोडिंग की है। इस प्रोजेक्ट में main फंक्शन मेनू को हैंडल करने का काम करेगा। जो मेनू हम choose करेंगे main फंक्शन उसी से रिलेटेड फंक्शन को कॉल करके उस प्रोसेस को पूरा कराने का काम करेगा।
search_word function :-
दोस्तों हमने इस फंक्शन के अंदर वर्ड को सर्च करने से रिलेटेड कोडिंग की है। की किस प्रकार वर्ड को सर्च करना है और फिर उस वर्ड को शो करना है। तो इस फंक्शन के अंदर हमने बस इसी से रिलेटेड कोडिंग की है।
add_word function :-
दोस्तों हमने इस फंक्शन के अंदर वर्ड को डिक्शनरी में ऐड करने से रिलेटेड कोडिंग की है। की किस प्रकार उस वर्ड को डिक्शनरी में ऐड करना है जिसे यूजर ने एंटर किया है। तो इस फंक्शन के अंदर हमने बस इसी से रिलेटेड कोडिंग की है।
show_dictionary function :-
दोस्तों हमने इस फंक्शन के अंदर डिक्शनरी को शो कराने से रिलेटेड कोडिंग की है। की किस प्रकार डिक्शनरी में ऐड सभी वर्ड्स को शो या प्रिंट करना है। यह फंक्शन डिक्शनरी में ऐड सभी वर्ड्स को उनके meanings के साथ शो कराने का काम करता है। तो इस फंक्शन के अंदर हमने बस इसी से रिलेटेड कोडिंग की है।
2.dictionary project source code :-
दोस्तों अब हम इस dictionary project का source code देख लेते है।
तो दोस्तों ये है इस प्रोजेक्ट का सोर्स कोड। हमने इस प्रोजेक्ट को विसुअल स्टूडियो कोड पर बनाया है और इसे gcc compiler से compile किया है। तो अगर आप इस प्रोजेक्ट को किसी दूसरे कम्पाइलर से compile करेंगे तो शायद आपको इस प्रोजेक्ट में कुछ एरर आ सकती है।
project source code :-
#include < stdio.h >
#include < string.h >
#include < stdlib.h >
char word[1000][30];
char word_meaning[1000][30];
int count_index = -1;
void show_dictionary()
{
if (count_index == -1)
{
printf("\nSorry! dictionary is empty Please add word first\n");
goto there;
}
printf("-----------------------------------\n");
printf("| Word | Meaning |\n");
printf("-----------------------------------\n");
for (int i = 0; i <= count_index; i++)
{
printf("| %s %s\n", word[i], word_meaning[i]);
printf("-----------------------------------\n");
}
there:
printf("\n");
}
void add_word()
{
char word1[30], word_meaning1[30];
printf("Enter word to add in dictionary: ");
fflush(stdin);
gets(word1);
for (int i = 0; i <= count_index; i++)
{
if (!strcmp(word1, word[i]))
{
printf("\nThis word is already exit\n");
goto there;
}
}
printf("Enter word meaning: ");
fflush(stdin);
gets(word_meaning1);
count_index++;
strcpy(word[count_index], word1);
strcpy(word_meaning[count_index], word_meaning1);
printf("\nWord is successfully added in dictionary\n");
there:
printf("\n");
}
void search_word()
{
char word1[30];
int check;
if (count_index == -1)
{
printf("\nSorry! dictionary is empty Please add word first\n");
goto there;
}
printf("Enter word to search: ");
fflush(stdin);
gets(word1);
for (int i = 0; i <= count_index; i++)
{
if (!strcmp(word1, word[i]))
{
printf("\n---------------------------------\n");
printf("| Word | Meaning |\n");
printf("---------------------------------\n");
printf("| %s %s\n", word1, word_meaning[i]);
printf("---------------------------------\n");
}
else
{
if (i == count_index)
{
printf("\nSorry! word is not found\n");
}
}
}
there:
printf("\n");
}
void main()
{
int choose;
printf("\n--------------------------------------------\n");
printf("| WELCOME TO ENGLISH OT HINDI DICTIONARY |\n");
printf("--------------------------------------------\n");
do
{
printf("Press 1 to search word\n");
printf("Press 2 to add word in dictionary\n");
printf("Press 3 to show dictionary\n");
printf("Press 4 to Exit\n");
again:
printf("Choose an option: ");
scanf("%d", &choose);
switch (choose)
{
case 1:
search_word();
break;
case 2:
add_word();
break;
case 3:
show_dictionary();
break;
case 4:
exit(0);
break;
default:
printf("Invalid option try again\n");
goto again;
}
} while (choose != 4);
}
project output :-
--------------------------------------------
| WELCOME TO ENGLISH OT HINDI DICTIONARY |
--------------------------------------------
Press 1 to search word
Press 2 to add word in dictionary
Press 3 to show dictionary
Press 4 to Exit
Choose an option: 2
Enter word to add in dictionary: orange
Enter word meaning: santra
Word is successfully added in dictionary
Press 1 to search word
Press 2 to add word in dictionary
Press 3 to show dictionary
Press 4 to Exit
Choose an option: 1
Enter word to search: orange
---------------------------------
| Word | Meaning |
---------------------------------
| orange santra
---------------------------------
Press 1 to search word
Press 2 to add word in dictionary
Press 3 to show dictionary
Press 4 to Exit
Choose an option: 4
3.dictionary project video :-
तो दोस्तों अगर आप इस प्रोजेक्ट की वीडियो देखना चाहते है तो आप हमारी यह वीडियो देख सकते है। इस वीडियो में हमने इस प्रोजेक्ट को अच्छी तरह समझाया है और साथ में इसे रन करके भी दिखाया है। तो अगर आप इस वीडियो को देखना चाहते है तो नीचे दी इमेज पर क्लिक करें।
इन पोस्ट को भी पढ़े -
- मार्कशीट जनरेशन प्रोजेक्ट इन C
- ग्रोसरी स्टोर बिलिंग सिस्टम प्रोजेक्ट इन C
- क्रिकेट पॉइंट्स टेबल प्रोजेक्ट इन C
Author :- तो दोस्तों अब हमारी यह Simple dictionary project in C language in Hindi पोस्ट ख़त्म होती है हम आशा करते है की आपको हमारी यह पोस्ट जरूर पसंद आई होगी और आप C language की मदद से dictionary को बनाने का project सीख गए होंगे। तो दोस्तों आज के लिए बस इतना ही फिर मिलेंगे ऐसी ही किसी और मज़ेदार पोस्ट में तब तक के लिए अलविदा !
0 Comments
Do not enter any spam comments please.