13.07.2015 Views

1st year EE - Centurion University

1st year EE - Centurion University

1st year EE - Centurion University

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

BLCS 1116 BASIC PROGRAMMING IN ‘C’ LABORATORY (0-0-3)C Programming: variables and expression assignment, simple arithmetic.Loops, if else, case statements, break, continue, goto.Single and multidimensional arrays.Functions, recursions, file handling in C.Pointers, address operators, declaring pointers and operations on pointers.Address of an array, structures, pointers to structures, dynamic memory allocation.Experiment no.1a) Write a C program to find the sum of individual digits of a positive integer.b) A Fibonacci sequence is defined as follows: The first and second terms in the sequence are 0and 1. Subsequent terms are found by adding the preceding two terms in the sequence. Write aC program to generate the first n terms in the sequence.c) Write a C program to generate all the prime numbers between 1 and n, when n is a valuesupplied by the user.Experiment no.2a) Write a C program to calculate the following sum:Sum=1 - x 2 /2! + x 4 /4! – x 6 /6! + x 8 /8! – x 10 /10!b) Write a C program to find the roots of a quadratic equation.Experiment no.3a) Write C programs that use both recursive and nonrecursive functions.I. To find a factorial of given numbers.II. To find GCD (Greatest common divisor) of two given numbers.III. To solve Towers Of Hanoi problem.Experiment no.4a) Write a C program to find both the largest and smallest number in a list of integers.b) Write a C program that uses functions to perform the following:i. Addition of two matrices.ii. Multiplication of two matrices.Experiment no.5a) Write a C program that uses functions to perform the operations:I. To insert a substring into a given main string from a from a given position.II. To delete n characters from a given position in the given string.b) Write a C program to determine if the given string is palindrome or not.12

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!