You are on page 1of 1

Controlled copy Cognizant In-Campus Training Programme Problem Solving and C Programming Lab List 1 Write an algorithm and

d draw a flow chart for the following problems. Also convert the algorithms into C Programming Language code and test the program. 1. Write a C program that produces the following output ************ * hello world * ************ 2. Let N and M be two positive integers. Find the greatest common divisor of N and M defined to be the positive integer D such that 1. D divides N and M, and 2. D is the largest integer dividing both N and M 3. Write a program to read ten numbers from the keyboard, and store them in an array of integers. Then print out the numbers in the reverse order. 4. Write a C program which calculates the sum 1/1 + 1/2 + 1/3 + 1/4 + ... + 1/N where N is a positive integer. 5. Write a C program to accept a string and a character. Then find whether that character is present in that string or not. 6. Write a C Program to accept a string and check whether that string contains only digits. 7. Develop a program in C to determine whether a given item X is present in given list of items. If so identify ALL the occurrences of X in the list. 8. Write a program to read one character at a time, and print each character and its decimal value. 9. Write a program to read one line at a time, and print each line backwards. To do the reversing, write a function. 10. Write a program to read lines and print only those lines containing a certain word. Accept the search word from user initially.

Copyright Cognizant Academy All Rights Reserved

You might also like