21
Q1. What is computer? What are different types of computer? Ans. Computer is an electronics machine that performs arithmetical and logical operations with great speed and accuracy. It takes data or information as input through input devices processes it the result as the output through output devices. Types of computer Analog computer digital computer hybrid computer Micro Mini Mainframe Super Computers Computers Computers Computers ANALOG COMPUTER: It takes data as variables directly from management instrument. These are used for measuring parameter that very continuously in very real time. EX. Temperature, Pressure, Voltage, Current etc DIGITAL COMPUTER: It takes the data as combination of 0 and 1 as off and on respectively it is based on the concept of binary digit system. EX. Computers which are used at homes and offices. HYBRID COMPUTERS: These are the combination of both analogue and digital computer it can process both descriped and continuous data. EX. Processor at petrol pumps, in ICU in hospital and in defence etc.

Computer Science Practical File

Embed Size (px)

DESCRIPTION

COMPUTER SCIENCE PRACTICAL FILE

Citation preview

Q1. What is computer? What are different types of computer?Ans. Computer is an electronics machine that performs arithmetical and logical operations with great speed and accuracy. It takes data or information as input through input devices processes it the result as the output through output devices. Types of computer

Analog computer digital computer hybrid computer

Micro Mini Mainframe Super Computers Computers Computers ComputersANALOG COMPUTER: It takes data as variables directly from management instrument. These are used for measuring parameter that very continuously in very real time.EX. Temperature, Pressure, Voltage, Current etcDIGITAL COMPUTER: It takes the data as combination of 0 and 1 as off and on respectively it is based on the concept of binary digit system.EX. Computers which are used at homes and offices.HYBRID COMPUTERS: These are the combination of both analogue and digital computer it can process both descriped and continuous data.EX. Processor at petrol pumps, in ICU in hospital and in defence etc.

Q2. What is software and different types of software?Ans. SOFTWARE: The logical parts of a computer system that cannot be seen and touched are called Software.SYSTEM SOFTWARES: The software that is design for the system is called system software.UTILITY SOFTWARES: These are the software that can be designed in increase the performance and efficiency of the computers Applications software these are the software designed for the use of system. These are oriented software.Computer Hardware Software

CPU Peripheral System Utility application Devices Software Software SoftwareALU CU MU Input output storage Computer written Software Devices Devices Devices Software packages Operating systems Translators

Single user OS Multiuser OS Assembler Interpretor Compiler

Q3. Describe followingI) ROMII) RAMIII) Decision control statementsIV) Primary data typesAns. ROM: i) It stands for read only memory.ii) It is the permanent storage of the computer.iii) It is non volatile in nature.iv) Programmes are store care at the time of devices manufacturing.v) Data store care cannot be modified or deleted. RAM:I) Ram stands for random access memory.II) It is volatile in nature.III) It is the temporary storage of the computer.IV) Data store here can be lost in case of power cut.V) When input is given data first comes in RAM.Decision control statements:These are the statement that govern the flow of control in a c programmeTypes of control statement

Sequential Statement Selection statement Looping statement

IF statement Switch case statement While loop do-while loop for loop

Primary data types: Data typesFormat specifaierStorage space

Chrector (chr)% c1 Byte

Integar (int)% d2 Byte

Float% f4 Byte

Double% lf8 Byte

Void -0 Byte

Print f: This is known as the output function in a c programme. It is used to print the message or to display the value of the variable as the output.Scan f: This is known as the input function in a c programme it is used to take or enter the data by the user.

Q4. Explain Output and input devices with five examples each?Ans. INPUT DEVICES: The devices that are used to enter or input the data in a computer is known as input devices.EX. 1) Keyboard2) Mouse3) :Light pen4) Scanner5) Joy stick

OUTPUT DEVICES: The devices that are used to give or display a result as the output are known as output devices.Eg.1) Monitor2) Printer3) Plotter4) Speaker5) Projector

Q5. What is c language? Explain features of c language?Ans. C language was developed by Dennis Ritchie at bell Laboratory U.S.A in 1972. It is general purpose programming language. It is based on the concept of procedures programming language. It is most commonly used language because of its principles. C is called middle language because it combines the power of high level language with the flexibility of high level language.FEATURES OF C LANGUAGE: 1) C is structural programming language.2) C is case sensitive in nature.3) It is machine independent and highly portable language.4) C language is easy to learn as it has only 32 keywords.5) It is provisional programming language.

Q6. Accept two numbers by the user and print their sum?Ans.#includevoid main(){int a,b,c;printf(enter the two numbers);scanf(%d%d,&a,&b);c=a+b;printf(the sum is %d,c);}

OUTPUT:enter the two numbers 24The sum is 6

Q7. Accept two numbers and print the largest?#includevoid main(){int a,b;printf(enter the two numbers);scanf(%d%d,&a,&b);if(a>b){printf(the largest number is %d,a);}else{printf(the largest number is %d,b); } }OUTPUT:enter the two numbers 1224the largest number is 24

Q8. Accept any number from the keyboard and print the number is odd or even?Ans.#includevoid main(){int a;printf(enter the number);scanf(%d,&a);if(a%2==0){printf(the number is even);}else{printf(the number is odd); }}OUTPUT:enter the number 44The number is even

Q9. Accept principal amount time and interest rate and calculate and print simple interest?Ans.#includevoid main(){int p,r,t;float si;printf(enter the principal, rate and time);scanf(%d%d%d, & p, & r, & t);si=(p*r*t)/100;printf( simple interest is %f, si);}OUTPUT:enter the principal,rate and time 50001010Simple interest is 5000

Q10. Accept employee salary, if HRA is 35%, DA is 57% of the employee salary then calculate and print gross salary of employee?Ans.#includevoid main(){int s, d, h, t;printf(enter the salary);scanf(%d,&s);d=s*57/100;h=s*35/100;t=s+d+h;printf(the new salary is %d,t);}

OUTPUT:enter the salary 8000the new salary is 15360

Q11.To accept the radius of the circle and print the area of it? Area of circle = 3.14*r*rAns.#includevoid main(){float r,a;printf(enter the radius of circle);scanf(%f,&r);a=3.14*r*r;printf( area of the circle is %f, a);}OUTPUT:the radius of circle is 10Area of cirlcle is 314

Q12. Print the table of 2 using loop Ans.#includevoid main(){int i=1,j=0;while(i 15000 then print EMPLOYEE IS LECTURER andIf salary is > 30000 then print EMPLOYEE IS PROFESSOR. Ans.#includevoid main(){int s;printf(enter the salary);scanf(%d, & s);if (salary >30000){printf("Employee is a Professor");}else{if(salary>15000){printf("Employee is a Lecturer");}else{printf("Employee is a Clerk");}}}OUTPUT:the salary is 50000The employee is professor