mohanrajthillai / Assessment_1

17-02 to 24-02
0 stars 0 forks source link

Assignment_1 #1

Open mohanrajthillai opened 1 year ago

mohanrajthillai commented 1 year ago

1) Pros and cons of C? 2) why C is preferred than python? 3) what is an object file (.obj)? 4) perform the following operations with basic linux commands a) create a new directory with name "NEW" b) create 5 new files inside that directory with name file1 and so ? c) write the features of c in file1 using vi editor? d) write about the historical development of c using "echo" command? e) use CAT command to combine file1 & file2 and write it in file3? f) move file4 outside current directory g) rename file5 as file6 h) list all the files in the NEW directory i) find the size of NEW directory j) check whether file6 exists in NEW directory 5) Suggest the possible datatype's for the following: a) EMBEDUR2023 b) 2022 c) 20.21 d) m e) 9003311417 f) 70000 g) height of 100 students h) to store another variable address i) to store employee details 6) write the suitable access modifier for each case: a) wanted to access completely in the project without any restrictions b) can be accessed by derived class c) cannot be accessed outside the respective class in which it is defined

StewartPhilip commented 1 year ago

ANSWERS:

  1. Pros of C: C is easy to learn and implement. It has numerous library functions Fast execution speed Cons of C: Less level of data abstraction Lack of OOPs concept No exception handling

  2. C than python: C is faster to execute than python. In C, we have declaration of the datatype of a variable, which is not present in Python.

  3. Object file:       Object file is the file that is obtained as the output of the assembler. It has the binary contents for further processing.

  4. Commands:

    mkdir NEW cd NEW touch file{1..5}.txt vi file1.txt // write the features of c and save and quit using ':wq' echo 'historical development of C' >> file1.txt cat file1.txt file2.txt > file3.txt mv file4.txt ../ mv file5.txt file6.txt ls du // prints the disk usage of current directory.

  5. Datatypes: a. character array b. int, short, long c. float, double d. char e. long f. int, long g. integer or float array h. pointer i. structure

  6. a. public b. protected c. private

mohanrajthillai commented 1 year ago

what is the command for the last question in the question 4.

StewartPhilip commented 1 year ago

I'll come there and tell u na ... Actually I couldn't guess it

On Thu, 23 Feb 2023, 13:39 mohanrajthillai, @.***> wrote:

what is the command for the last question in the question 4.

— Reply to this email directly, view it on GitHub https://github.com/mohanrajthillai/Assessment_1/issues/1#issuecomment-1441349032, or unsubscribe https://github.com/notifications/unsubscribe-auth/AV7FWVIA7EATGEXNMSRIF3DWY4LLLANCNFSM6AAAAAAVCUISKQ . You are receiving this because you were assigned.Message ID: @.***>