Tuesday, May 28, 2019

Overview of C Programming Language

The C programming language was developed by Dennis Ritchie at the Bell Laboratories in 1972. C evolved from two earlier languages called BPCL and B which were developed at Bell laboratories. Because of its features, C became popular very fast and by 1980s it was one of the most popular programming language being used.

C is a general purpose structured programming language. It has a rich set of data types and has a syntax that uses the English language keywords. Its features categorize it as a high level language. C has additional features that allow it to be used at the lower level, thus bridging the gap between the machine language and the conventional high level languages. This flexibility allows C to be widely used for systems programming.

C compilers are commonly available for computers of all sizes. The compilers are usually compact, and they generate object codes that are small and highly efficient as compared to programs compiled in other high level languages.

An important characteristic of C is that the programs are highly portable. This is because C implements most computer dependent functions as its library functions. 

Every version of C is accompanied by its own set of library functions. The library functions are relatively standardized. Therefore, most C programs can be processed on many different computers with little or no alteration. Most commercial C compilers support the features of C that are included in the ANSI standard.

BASIC STRUCTURE OF A C PROGRAM

Documentation Section
Link Section
Definition Section
Global Declaration Section
Main()
{
Declaration Section
Executive part
}
Subprogram section
Function 1
Function 2
-
-
Function n

Documentation Section – This section consists of a set of comment lines giving the name of the program and other details.

Link Section – This section provides instructions to the compiler to link functions from the system library. C program depends upon some header files for function definition that are used in the program. Each header file has extension ‘.h’. The header files are included at the beginning of the program in the C language. These files should be included using #include directive as given below

Example:
#include
(This will find header file in standard directory)
Or
#include<stdio.h> (This will find header file in Current and Standard directory)

Definition Section – This section defines all symbolic constants.

Global Declaration Section – There are some variables and those variables are declared in this section that is outside of all functions.

main() function – Every C program must have one main() function section. int main(void) is the function definition for main(). Parenthesis followed to main is to tell the user again that main() is a function. int main(void) function return an integer.

void main(void) – This function takes no arguments and returns nothing. The program contains statements that are enclosed within the braces. The opening braces “{“ and closing braces “}”. In these two braces main() function two parts, declaration part and executable part. It is user defined function. The opening braces sometimes called logical start and closing braces known as logical end of the program.
Declaration Part declares all the variables used in the executable part. There should be at least one statement in the executable part which contains instructions to perform certain task. The declaration and executable part must appear between the opening and closing braces. All statements in the declaration part should end with the semicolon.

Subprogram Section – This section contains all the user defined functions that are called in the main function.

Write a program to illustrate the use of comment statement.

#include<stdio.h>
Void main()
{
/* Start of Printing */
printf(“My first C program.”);
/* End of Printing */
}

Test run:
My first C program.

  • ·        The opening brace { in the second line of the program marks the beginning of the function main(). The closing brace } after the set of statements marks the end of the function main() and also the end of the program.
  • ·        The set of statements to be executed are written within the braces { } and is called the function body. It is responsible for performing a specific task. The statements may be in the form of declarations, expressions, assignment statements, predefined functions, control statements or compound statements.
  • ·        The statement printf(“My first C program”); is an executable statement and on execution it displays

            My first C program
        on the screen. printf() is a predefined library function in C.
  • ·        The semicolon (;) at the end of the printf() statement is called a statement terminator. Every statement in a C program ends with a semicolon. A missing semicolon generates a syntax error.
  • ·        The #include<stdio.h> is a preprocessor directive that includes the header file stdio.h in the program. The header file contains the pre-defined function printf() and is referred to use this function in the program. Any number of header files can be included in a program file depending upon the library functions used in the program. Header files are generally included at the beginning before the main().
  •           The line beginning with /* and ending with */ is called a command line or a remark line. Comment lines are non-executable, and anything between /* and */ is ignored by the compiler. Comment lines are used in C programs to increase the understandability of the program. The comment lines can be inserted at the beginning of the program before the main () or within a function.



 C is a middle level language i.e. has the capabilities of the low level languages as well as the high level languages.
·        C is a highly portable language. A C program written for one computer or operating system can be run on another computer or operating system with little or no modification.
·        C is a highly structured language and C program are written as collection of modules or functions.
·        C has a well defined syntax or set of rules.
·        Execution of a C program starts with the main() function.
·        C is a case-sensitive language. It is case sensitive because it follows strict rules even in an alphabetical case either lowercase or uppercase. For example, typing Int instead of int result in compilation error. Because there is uppercase I instead of lowercase i in the example.
·        Every C statement is terminated by a semicolon (;).

·        Comment statements are non executable statements.

Tuesday, January 29, 2019

তাজমহল

ভারতের  উত্তর প্রদেশের আগ্রায় অবস্হিত একটি রাজকীয় সমাধি হচ্ছে তাজমহল। এটা নির্মান করেন মুঘল সম্রাট শাহজাহান তার স্ত্রী আরজুমান্দ বানু বেগমের স্মৃতির উদ্দেশে যিনি মুমতাজ মহল নামে পরিচিত। সৌধটি একটি অপূর্ব নিদর্শন আর এটার নির্মান শুরু  হয়েছিল ১৬৩২ খ্রীস্টাব্দে এবং সম্পুর্ন হয়েছিল ১৬৫৩ সালে।
উস্তাদ আহমেদ লাহুরি তাজমহলের নকশাকারক ছিলেন। এর নির্মান শৈলীতে পারস্য, তুরস্ক, ভারতীয় ও ইসলামী স্হাপত্য শিল্পের সম্মিলন ঘটানো হয়েছে।
তাজমহল একটি সাদা মার্বেল পাথরের জটিল অখন্ড স্হাপত্য।
 ১৯৮৩ সালে এটি ইউনেস্কোর বিশ্ব ঐতিহ্যবাহী হিসেবে স্হান নেয়। বিশ্বের সপ্তম আশ্চর্যের একটি হচ্ছে তাজমহল।  সম্রাট শাহজাহান তার স্ত্রী মুমতাজ মহলের মৃত্যুতে প্রচন্ড শোকাহত হয়ে পড়েন এবং ১৬৩১ সালে তাজমহলের নির্মান কাজ শুরু হয়।তাজমহল তৈরী করা হয়েছে হুমায়ুনের মাজার, দিল্লীর জামা মসজিদ এবং ইমামদ্দৌলার মাজারের নকশা অনুযায়ী।  তাজমহলের সামনের চত্বরে একটি চারবাগ বাগান করা হয়েছিল এবং বাগানটি ১৬টি বাগানে বিভক্ত করা হয়েছিল। বাগানের মাঝখানে একটি উচু মার্বেল পাথরের চৌবাচ্চা বসানো আছে।
বাগানে আরো বেশকিছু বৃক্ষশোভিত রাস্তা ও ঝর্না আছে। কালে কালে মুঘলদের অবক্ষয়ের সাথে সাথে বাগানেরও অবক্ষয় ঘটে। ইংরেজ আমলে ইংরেজরা তাজমহলের রক্ষনের দ্বায়িত্ব নেয় এবং বাগানের রুপ দেয়া হয় লন্ডনের বাগানের অনুরপ। তাজমহল মুলত সাদা মার্বেল পাথরে তৈরী এবং মূল কাঠামোটি বিশাল এবং কয়েক কক্ষ বিশিষ্ট। মুমতাজ মহল ও শাহজাহানের স্মৃতিফলক প্রধান কক্ষটিতে বসানো হয়েছে। ইমারতটিতে চারটি মিনার রয়েছে। সমাধির উপরে মার্বেল পাথরের বড় গম্বুজ আছে। সমাধির প্রবেশপথে ধনুক আকৃতির দরজা রয়েছে। তাজমহল ৫৫ মিটার লম্বা আর সমাধিটি ব্যাসে ১৮ মিটার এবং উচ্চতায় ২৪ মিটার। তাজমহল ৫৫ মিটার লম্বা আর সমাধিটি ব্যাসে ১৮ মিটার এবং উচ্চতায় ২৪ মিটার। তাজমহল তৈরী করা হয়েছে সারা এশিয়া ও ভারতের বিভিন্ন উপাদান সামগ্রী দিয়ে। নির্মান কাজে ১০০০এর বেশী হাতি ব্যাবহৃত হয়েছিল মালামাল বহনের জন্য। রাজস্হান থেকে আনা হয়েছিল আলোপ্রবাহি অস্বচ্ছ মার্বেল পাথর, পান্জাব থেকে লাল,হলুদ বাবাদামি রংয়ের পাথর, কঠিন সাদা সবুজ পাথর আনা হয়েছিল চীন থেকে,সবুজ নীলাভ ফিরোজা পাথর তিব্বত থেকে, নীলকান্তমনি আনা হয়েছিল আফগানিস্তান থেকে  এবং  খয়েরী বা সাদা রংয়ের পাথর আনা হয়েছিল আরব থেকে।  আঠাশ ধরনের মূল্যবান পাথর সাদা মার্বেল পাথরে বসানো হয়েছে। তাজমহল নির্মানে তখন খরচ হয়েছিল ৩২ মিলিয়ন রুপি কিন্তুু শ্রমিকের মজুরি এবং ভিন্ন অর্থনৈতিক যুগের কারনে এর খরচ অমূল্য
ধরা হয়।




তাজমহল