0% found this document useful (0 votes)
23 views1 page

Cognizant In-Campus Training Programme Problem Solving and C Programming - Lab List 1

The document provides 10 problems to solve using algorithms, flow charts, and C programming code. The problems include printing a pattern, finding the greatest common divisor of two numbers, storing and printing numbers from an array in reverse order, calculating a sum of fractions, checking if a character is in a string, checking if a string only contains digits, finding all occurrences of an item in a list, printing characters and their decimal values, printing lines backwards, and printing lines containing a certain word.

Uploaded by

Raffi Sk
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views1 page

Cognizant In-Campus Training Programme Problem Solving and C Programming - Lab List 1

The document provides 10 problems to solve using algorithms, flow charts, and C programming code. The problems include printing a pattern, finding the greatest common divisor of two numbers, storing and printing numbers from an array in reverse order, calculating a sum of fractions, checking if a character is in a string, checking if a string only contains digits, finding all occurrences of an item in a list, printing characters and their decimal values, printing lines backwards, and printing lines containing a certain word.

Uploaded by

Raffi Sk
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 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