Simple C program(#2 Array multioptions)

Welcome again guys! I already said before in my previous post that I will keep update about my simple program C language. So for today entry, The program is something that most programmers C already get use with which is array.

Let me briefly describes what is an array. Array is something like a data structure that keeps data in fixed-size sequential collection of elements. And the data must be in same data type. If the array stores integer value, so all the other values must be integer. Different data type in on single array may result in error. An analogy that could describe array is a cupboard. Cupboard is an array. Inside the cupboard must have some spaces to put all clothes. This space is the elements. And the data in the array is the clothes. Well, I hope that could help you understand what is array is in a simple analogy. If you have any inquiry related to the array please let me know in the comment. I will try my best to explain it more to you guys.

Check this link for further details about array.

Array

Alright, enough of the brief session. Let’s get start with the program. I tend to explain about my program so that all of you may grab some ideas about what my program is all about. So, this program is a menu-driven type program. It consists of 5 operations with 9 sub-operations you may want to do with a listed of 2D random array numbers.

The 5 operations and 9 sub-operations are:

  1. Calculate the total and average of arrays
    • The entire 2D array
    • A specified row
    • A specified column
  2. Identify highest lowest value in the arrays
    • The entire 2D array
    • A specified row
    • A specified column
  3. Determine the presence of an array number using search key
  4. Sort the entire 2D arrays
    • Its original form
    • Ascending form
    • Descending form
  5. Print frequency of each random array numbers

 

The program end after you finish run the selected operation.

array2
One of the operation inside the program

Well, I think that’s all my entry for this time. Have a nice day folks!

Advertisements

Simple C Program (#1 Palindrome)

[English version]

Welcome guys! On this entry, I will share to you guys some of my simple C language programs that I did when I was in first semester in university. Some of them are really simple and easy. Just to let you guys know how it would be when you take software engineering or computer science courses in your university one day perhaps.

Before that, I would like to tell you guys about C language history. I would try to make it clear and simple. I know history is such a boring topic to discuss here, so let’s just direct to the point. C language is designed by Dennis Ritchie, American computer scientist along with his friend, Ken Thompson. C language is widely use in software applications, embedded system and C language is the great great ancestor for many popular languages nowadays such as C++,  Java, Objective-C and so on. It is a good programming language for people that want to learn how to code. Keywords inside C language is not a lot compare to other such as C++ and Java.

Alright, enough of the briefing. Let’s get into the simple program I told you guys about that I built before. For now, I will just introduce to you guys one of my simple program. I will post more about my program in the next entry. I will try to upload more than one program. Wish me guys. Let’s begin!

This program is about palindrome testing for positive numbers. You will be prompt to enter positive number in the program. If you otherwise enter a negative number, you will be warned by the program and ask you to enter positive number again. The program will continue to run until you enter number ‘0’ in the program then the program will exit.

 

For those who wants to know the source code and the executable file, follow me on Telegram channel in this link:

Telegram Channel

If you find any difficulties, please let me know inside the comment.I still figure out how to insert file inside WordPress for this moment. Anyone that could help me with that I am truly appreciate it. It would make me easier to share things with you guys! That’s all for this entry.

[Versi Bahasa Melayu]

Selamat datang semua! Dalam entri pada kali ini, saya ingin berkongsi kepada anda semua program-program pengaturcaraan bahasa C saya sewaktu saya mula-mula membinanya semester lepas. Sebahagian daripada program tersebut tersangatlah ringkas dan senang. Saya hanya ingin anda semua tahu apa yang akan berlaku sekiranya anda semua mengambil kursus Kejuruteraan Perisian atau Komputer Sains di universiti anda pada masa akan datang.

Sebelum tu, saya ingin memberitahu anda sejarah bahasa C. Saya akan cuba sedaya upaya untuk menjadikannya ringkas dan jelas. Saya tahu sejarah satu topik yang agak membosankan untuk dibincangkan disini, jadi kita akan terus kepada isinya! Bahasa C direka oleh Dennis Ritchie, seorang ahli komputer saintis Amerika bersama kawannya, Ken Thompson. Bahasa C banyak digunakan dalam aplikasi perisian, sistem dan bahasa C adalah moyang kepada bahasa popular yang terdapat pada masa sekarang seperti C++, Java, Objective-C dan sebagainya. C merupakan bahasa pengaturcaraan yang bagus kepada sesiapa yang ingin belajar pengaturcaraan. Kata kunci didalam bahasa C tidak terlalu banyak jika ingin dibandingkan dengan yang lain seperti C++ dan Java.

Baiklah, cukup dengan pengenalan. Mari lihat program yang saya ceritakan sebelum ini. Saya hanya akan memberitahu kepada anda semua salah satu daripada program saya. Saya akan berkongsi lebih lagi pada entri yang akan datang. Saya akan cuba untuk berkongsi lebih dari satu program. Doakan semua! Jom mulakan!

Program ini berkenaan dengan palindrome untuk nombor positif. Anda akan segera diminta untuk memasukkan nombor positif dalam program tersebut. Sekiranya anda memasukkan nombor negatif, anda akan diberi amaran dan diminta untuk memasukkan nombor positif sekali lagi. Program akan terjus berjalan sehinggalah anda memasukkan nombor ‘0’ dalam program dan selepas itu program akan berhenti.

 

Kepada sesiapa yang ingin mendapatkan sumber kod dan fail, ikut saya dalam Telegram channel di pautan ini:

Telegram channel

Sekiranya anda menghadapi sebarang kesusahan, harap dapat beritahu kepada saya melalui komen. Saya masih fikir bagaimana hendak memasukkan fail dalam WordPress buat masa kini. Sesiapa yang dapat menolong saya dalam hal ini amatlah saya hargai. Ini dapat memudahkan saya untuk berkongsi benda kepada anda semua! Itu sahaja untuk entri kali ini.

Elementary OS

[English version]

Not many people know about Elementary OS. It is a Linux distribution based on Ubuntu. It has been around since year 2011 and since that year, it grows and evolve until now. This OS is completely free and open source compared to other OS such as Windows and Mac in which they need to pay for the system. The OS focus on simplicity and ease of use for the normal people to use it. One of the thing that I found in this OS is it is really beautiful. The GUI is easy to use and you could navigate easily between applications. The OS is lightweight and fast as well.

The OS comes with pre built-in applications for watching videos, viewing photos, PDF documents, listening to musics and many more meaning that after the fresh installation of the OS in your computer, you don’t have to waste your time downloading and searching for applications. It’s already there! Unfortunately, the OS not come with built-in application for office use to edit documents like Microsoft Office but you could download it easily in the OS Software Center. One of the office application is LibreOffice and it’s free to use.

Overall, this is the OS for people that just come to the world of Linux. It’s really easy to use and the environment system is really well designed by the developers. Good job! That’s all for this entry.

Check out what other say about Elementary OS:

  • WIRED : “elementary OS is different… a beautiful and powerful operating system that will run well even on old PCs”
  • lifehacker : “Lightweight and fast, not to mention customizable. Completely community-based, and has a real flair for design and appearances”

Check out this link for more details about the OS:

Official Elementary OS link

Wikipedia link

Elementary_OS_0.3__Freya_
Latest release for Elementary OS; Elementary OS Freya

[Versi Melayu]

Tidak ramai orang tahu mengenai Elementary OS. Ia merupakan salah satu daripada cabang Linux berlandaskan Ubuntu. Elementary telah lama beroperasi sejak tahun 2011 dan bermula tahun itulah ia berevolusi sehingga kini. OS ini percuma sepenuhnya dan sumber terbuka berbanding OS yang lain seperti Windows dan Mac yang mana mereka harus membayar untuk OS tersebut. Salah satu perkara yang dapat saya lihat dalam OS ini, ia sangat cantik. Grafik antaramuka sangat mudah untuk digunakan dan anda juga mudah untuk navigasi di antara aplikasi. OS ini juga ringan dan pantas.

OS ini datang dengan aplikasi yang telah dipasang untuk menonton video, melihat gambar, dokumen PDF, mendengar lagu dan banyak lagi bermakna selepas memasang OS ini dalam komputer, anda tidak perlu menghabiskan masa mencari dan memasang aplikasi-aplikasi tersebut lagi. Sudah terbina di dalam OS tersebut! Malangnya, OS ini tidak didatangkan bersama untuk kegunaan pejabat untuk menyunting dokumen seperti Microsoft Office tetapi anda dapat memuat turun dengan mudah didalam OS Software Center. Salah satu aplikasi tersebut ialah Libre Office dan ia percuma untuk digunakan.

Kesimpulan, OS ini adalah untuk sesiapa yang baru sahaja berjinak-jinak di dunia Linux. Ia sangat mudah untuk digunakan dan persekitaran sistem tersebut direka dengan sangat baik oleh para pembangun. Kerja yang baik! Itu sahaja untuk entri kali ini.

Lihat apa yang dikatakan oleh yang lain berkenaan Elementary OS:

  • WIRED : “elementary OS is different… a beautiful and powerful operating system that will run well even on old PCs”
  • lifehacker : “Lightweight and fast, not to mention customizable. Completely community-based, and has a real flair for design and appearances”

Lihat pautan ini untuk mendapatkan informasi lebih berkenaan OS:

Official Elementary OS link

Wikipedia link