Tribhuvan University Institute of Science and Technology 2065

Similar documents
Scheme G. Sample Test Paper-I. Course Name : Computer Engineering Group Course Code : CO/CD/CM/CW/IF Semester : Second Subject Tile : Programming in C

Questions Bank. 14) State any four advantages of using flow-chart

PROGRAMMING IN C AND C++:

Subject: Computer Science

INDIAN SCHOOL MUSCAT COMPUTER SCIENCE(083) CLASS XI

(i) Describe in detail about the classification of computers with their features and limitations(10)

Kadi Sarva Vishwavidyalaya, Gandhinagar

B. V. Patel Institute of Business Management, Computer & Information Technology, UTU 2013

VALLIAMMAI ENGINEERING COLLEGE SRM NAGAR, KATTANGULATHUR

M4.1-R3: PROGRAMMING AND PROBLEM SOLVING THROUGH C LANGUAGE

Reg. No. : Question Paper Code : B.E./B.Tech. DEGREE EXAMINATION, JANUARY First Semester GE 6151 COMPUTER PROGRAMMING

Subject: Fundamental of Computer Programming 2068

VARIABLE, OPERATOR AND EXPRESSION [SET 1]

M3-R4: PROGRAMMING AND PROBLEM SOLVING THROUGH C LANGUAGE

UNIT I : OVERVIEW OF COMPUTERS AND C-PROGRAMMING

Question Bank (SPA SEM II)

Name :. Roll No. :... Invigilator s Signature : INTRODUCTION TO PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70

Subject: PROBLEM SOLVING THROUGH C Time: 3 Hours Max. Marks: 100

Programming & Data Structure Laboratory. Day 2, July 24, 2014

3 The L oop Control Structure

C-LANGUAGE CURRICULAM

For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit

r } ~ ~ ~.,-~_.-.,..--- ~.._ ~ -.- " ~.., ~ i-~--~-..., _-_... 4 _-~ _. '".~ j l.- ~ i...l...i- ~.JI

An array is a collection of data that holds fixed number of values of same type. It is also known as a set. An array is a data type.

B.V. Patel Institute of Business Management, Computer & Information Technology, Uka Tarsadia University

Downloaded from

Course Title: C Programming Full Marks: Course no: CSC110 Pass Marks: Nature of course: Theory + Lab Credit hours: 3

Practice problems Set 2

Aryan College. Fundamental of C Programming. Unit I: Q1. What will be the value of the following expression? (2017) A + 9

Code No: R Set No. 1

ALGORITHM 2-1 Solution for Exercise 4

UNIVERSITY OF ENGINEERING & MANAGEMENT, KOLKATA C ASSIGNMENTS

Programming & Data Structure Laboratory. Arrays, pointers and recursion Day 5, August 5, 2014

Flow Chart. The diagrammatic representation shows a solution to a given problem.

SHARDA UNIVERSITY SCHOOL OF ENGINEERING & TECHNOLOGY Mid Term Examination, (Odd Term, ) SOLUTION

Programming for Problem Solving 105A L T P Credit Major Minor Total Time

Assignment: 1. (Unit-1 Flowchart and Algorithm)

Week 0. Net Salary =Earnings- deductions; Read the employee number, Basic Print employee Number, Earnings,Deductions and Net salary.

Gujarat University M. Sc. Computer Science [S. F.] Semester-1 Syllabus Gujarat Arts & Science College, Ahmedabad.

Hrs Hrs Hrs Hrs Hrs Marks Marks Marks Marks Marks

AHLCON PUBLIC SCHOOL, MAYUR VIHAR I, DELHI ASSIGNMENT CLASS XI Session Chapter 1: Computer Overview

The Hyderabad Public School, Begumpet, Hyderabad, A.P

'C' Programming Language

Other Loop Options EXAMPLE

Computer Programming. C Array is a collection of data belongings to the same data type. data_type array_name[array_size];

Multiple Choice Questions ( 1 mark)

How to declare an array in C?

Reg. No. : Question Paper Code : 27157

Syllabus of Diploma Engineering. Computer Engineering. Semester: II. Subject Name: Computer Programming. Subject Code: 09CE1104

C- PROGRAMMING (3:0:0) Sub code : CS1C01/CS2C01 CIE : 50%Marks Hrs/week : 03 SEE : 50%Marks SEE Hrs : 03 Hours Max. Marks: 100 Course Outcomes:


I BCS-031 BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination. June, 2015 BCS-031 : PROGRAMMING IN C ++

Functions. Arash Rafiey. September 26, 2017

Engineering 12 - Spring, 1999

CSC-140 Assignment 5

PROGRAMMING IN C LAB MANUAL FOR DIPLOMA IN ECE/EEE

Analysis of Algorithms Part I: Analyzing a pseudo-code

List of Practical for Class XII Computer Science

(Following Paper ID and Roll No. to be filled by the student in the Answer Book)

Unit 3 Decision making, Looping and Arrays

Introduction to C Language (M3-R )

M1-R4: Programing and Problem Solving using C (JAN 2019)

Solution Set(Reference Book - Programming with c By Byron Gottfried Thrid Edition)

PDS Lab (Assignment 1) Date: 31 st July, 2017 (2-6 pm)

Fundamentals of Computer Programming Using C

ESC101N: Fundamentals of Computing End-sem st semester

Decision Making and Branching

C PROGRAMMING LANGUAGE. POINTERS, ARRAYS, OPERATORS AND LOOP. CAAM 519, CHAPTER5

Dept. of CSE, IIT KGP

COMPUTER PROGRAMMING LAB

CHOICE BASED CREDIT SYSTEM (With effect from )

Pointers (part 1) What are pointers? EECS We have seen pointers before. scanf( %f, &inches );! 25 September 2017

Object Oriented Programming Using C++ Mathematics & Computing IET, Katunayake

Control Statements. If Statement if statement tests a particular condition

Arrays. CS10001: Programming & Data Structures. Pallab Dasgupta Dept. of Computer Sc. & Engg., Indian Institute of Technology Kharagpur

Lab #10 Multi-dimensional Arrays

Midterm Examination # 2 Wednesday, March 19, Duration of examination: 75 minutes STUDENT NAME: STUDENT ID NUMBER:

Arrays. Arrays are of 3 types One dimensional array Two dimensional array Multidimensional array

Practical List of. MCA IV SEM Session -2010

Arrays and Strings. Arash Rafiey. September 12, 2017


Chapter 7 Arithmetic

Exercise(s) Solution(s) to the exercise(s)

Single Dimension Arrays

END TERM EXAMINATION

C & Data Structures syllabus

CS 199 Computer Programming. Spring 2018 Lecture 2 Problem Solving

A3-R3: PROGRAMMING AND PROBLEM SOLVING THROUGH 'C' LANGUAGE

2/29/2016. Definition: Computer Program. A simple model of the computer. Example: Computer Program. Data types, variables, constants

n Group of statements that are executed repeatedly while some condition remains true

CSC 1300 Exam 4 Comprehensive-ish and Structs

PROGRAM DESIGN TOOLS. Algorithms, Flow Charts, Pseudo codes and Decision Tables. Designed by Parul Khurana, LIECA.

List of Practical for Master in Computer Application (5 Year Integrated) (Through Distance Education)

IV Unit Second Part STRUCTURES

EXAMINATION FOR THE BSC (HONS) INFORMATION SYSTEMS; BSC (HONS) INFORMATION TECHNOLOGY & BSC (HONS) COMPUTER SCIENCE; YEAR 1

Computers Programming Course 11. Iulian Năstac

Loops / Repetition Statements

PROGRAMS. EXCELLENT ACADEMY OF ENGINEERING. Telephone: / NORMAL PROGRAM

MODULE 2: Branching and Looping

School of Computer Science Introduction to Algorithms and Programming Winter Midterm Examination # 1 Wednesday, February 11, 2015

Transcription:

1CSc.102-2065 2065 Candidates are required to give their answers in their own words as for as practicable. 1. Draw the flow chart for finding largest of three numbers and write an algorithm and explain it. 2. Find the valueof a in each of the following statements: int i = 3, j = 4, k =8; float a = 4.5, b = 6.5, c = 3.5; a) a = b-i/k + c/k b) a = (b-k)/j + (j+c)/k c) a = c - ((i+j)/(k+i)) *b d) a = c - i + j/k + i * b e) a = c + j % 2 +b f) a = (b + 1) % (c + 1) 3. Write a program for the interest charged in installments for following case. A cassette player costs Rs. 2000. A shopkeeper sells it for Rs. 100 down payment and Rs. 100 for 21 more months. What is the monthly interest charged? 4. Write a program that uses a for loop to compute and prints the sum of a given numbers of squares. 5. Write a program to obtain the product of the following matrices and explain it: A = 3 5 7 2 3 4 4 5 2 B = 7 6 6 5 4 3 6. Write a function to add, subtract, multiply and divide two complex numbers (x + iy) and (c + id). 7. Write a program which will read a line and delete from it all occurrences of the word that. 8. What is pointer and explain its applications? Write a program that uses pointers to copy an array of double. 1

1CSc.102-2065 Define a pointer. Write a function that is passed an array of n pointers to the maximum of the n floats. 9. Define a structure of employee having data members name, address, age and salary. Take data for n employee in an array dynamically and find the average salary. 10. Given a text file, create another text file deleting the following words three, bad and time. Why do you require graphical function? Explain the basic graphical function with suitable program. 2

1CSc.102-2066 2066 Candidates are required to give their answers in their own words as for as practicable. 1. Why flowchart is required? Explain different symbols used in the flow chart and explain with suitable example. 2. Determine which of the following are valid identifiers? If valid, explain why? a) record1 b) 1record c) file_3 d) return e) #tax f) name g) goto h) name and address i) name-and-address j) 123-45-6789 k) Void l) name_address 3. Find the error in the given program and explain it. Write the correct program. #include<stdio.h> #include<math.h> main { float p,r,n; printf( Please enter the value for the principal (P): ); scanf(%f, &p): printf( Please enter the value for the interest rate (R)); scanf( %f, &r); printf( Please enter the value for the number of years (n): ); scanf( %f, n); = p * pow + r/100), n); Printf( \n The final value (F) is: %. 2f\n, f); 4. Write a program that uses a while loop to compute and prints the sum of a given numbers of squares. For example, if 4 is input, then the program will prints 30, which is equal to 1 2 + 2 2 + 3 2 + 4 2 5. Write a program to enter two 3 x 3 matrices and calculate the product of given matrices. 6. Explain the use of two dimensional arrays. Illustrate it with suitable program and explain it. 3

1CSc.102-2066 7. Write and test the following power ( ) function that returns x raised to the power n, where n can be any integer: double power (double x, int p) 8. Justify that pointer is jewel in C language. Write a function that is passed an array of n pointers to floats and returns a newly created array that contains those n float values in reverse order. Assume any necessary data. Explain pointer with suitable diagram. Write a function that uses pointers to search for the address of a given integer in a given array. If the given integer is found, the function returns its address; otherwise it returns NULL. 9. Why structure is required? Make a program using structure of booklist having data members title, author and cost. Enter four data and calculate total cost. 10. Create a text file and enter to write a good program is very time consuming job. Create another text which contains reverse of above text. Explain the use of graphical function. Make a program that contains basic graphic functions. 4

1CSc.102-2067 2067 Candidates are required to give their answers in their own words as for as practicable. 1. Draw the flow chart for the solution of a quadratic equation and write an algorithm and explain it. 2. Find the value of a in each of the following statements: int i = 2, j = 5, k = 7; float a = 1.5, b = 2.5, c = 3.5; a) a = c i/j + c/k; b) a = (c-i)/k + (j+b)/j; c) a = b * b (( i + j)/c); d) a = b k + j/km + i * c; e) a = c + k % 2 + b; f) a = (b + 4) % (c + 2); 3. A machine is purchased which will produce earning of Rs. 20000 per year while it lasts. The machine cost Rs. 120000 and will have a salvage value of Rs. 20000 when it is condemned. If the 12 percent per annum can be earned on alternative investments what should be the minimum life of the machine to make it a more attractive investement compared to alternative investements? 4. Write a program to transpose the following matrix. 3 7 5 2 8 A = 2 5 8 3 4 6 9 3 6 5 5. Write a program that uses a do while loop to compute and prints the sum of squares given n numbers. 6. Write a function to multiply two n x n matrices. 7. Write a program to count the number of words in sentence. 8. Why pointer is called jewel of C language? Write a program that uses pointers to copy an array of integer. 5

1CSc.102-2067 Explain the importance of pointer. Write a function that is passed an array of n pointer to floats and returns a newly created array that contains those n float values. 9. Define a structure of student having data members name, address, marks in C languages and marks in information system. Take data for n students in an array dynamically and find the total marks obtained. 10. Some text file is given, create another text file replacing the following words Ram to Hari, Sita to Gita, and Govinda to Shiva. What are the uses of graphical function? Explain the basic graphical function with suitable program. 6

1CSc.102-2068 2068 Candidates are required to give their answers in their own words as for as practicable. 1. Write an algorithm and flow chart to determine whether a given integer is odd or even and explain it. 2. How can you declare the variable in C? Explain with example. 3. Write a program to find the factorial of a given integer. 4. Explain switch statement with example. 5. Write a program to find the largest and smallest among the given elements in array. 6. Explain the user-defined functions and its type with example. 7. Write a program to accept numbers and sort them with using pointer. 8. Explain the passing structure to function with example. 9. Write a program to accept any number and print the sum of the number up to a single digit through recursive function. 10. Explain the pointer to structure with example. Write short notes on: a) Dynamic memory allocation b) Opening and closing file 7

CSc.102-2069 2069 Candidates are required to give their answers in their own words as for as possible. 1. What an algorithm and flow chart to find out whether a given integers is zero, +ve or ve and explain it. 2. What are the basic four data types uses in c programming? What are its size and range? 3. Explain the if else statement with example. 4. Differentiate between break and exit statement with example. 5. Explain the multidimensional array with examples. Write a program to convert a lowercase character string into uppercase. 6. Explain the library functions with examples. 7. Write a program to find the sum of all the elements of an array suing pointers. 8. Explain the pointer arithmetic with example. 9. Explain the array of structure and write a program to accept record of 15 person which has name, age and address and also display them. 10. What are the three types of input/output functions with support in C-programming? Explain with example. Write short notes on: a) Delimiters b) Graphics function 8