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

C programs-SG

This document outlines several C programming practice assignments including printing different patterns like half pyramids and Pascal's triangles, using recursive functions to calculate sums and find Armstrong numbers, manipulating arrays by finding second largest elements and sorting even and odd elements separately, and performing operations on strings like counting words, replacing characters, and finding indexes.

Uploaded by

rjlhq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views1 page

C programs-SG

This document outlines several C programming practice assignments including printing different patterns like half pyramids and Pascal's triangles, using recursive functions to calculate sums and find Armstrong numbers, manipulating arrays by finding second largest elements and sorting even and odd elements separately, and performing operations on strings like counting words, replacing characters, and finding indexes.

Uploaded by

rjlhq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

C Programming Practice Assignment

1. WAP to print half pyramid, inverted pyramid, full pyramid, Pascal's triangle,
and Floyd's triangle in C Programming.

2. i) WAP to find the sum of natural numbers using a recursive function.


ii) WAP to display Armstrong numbers between two intervals.
iii) Write a C program to swap first and last digits of a number using while
loop.
iv) Write a C program to print total number of days in a month (the month
should be user input) using switch case.

3. i) Write a C program to find second largest element in an array.


ii) Write a C program to copy all elements from an array to another array.
iii) Write a C program to sort even and odd elements of array separately.

4. i) Write a C program to count total number of words in a string.


ii) Write a C program to replace all occurrences of a character with another
in a string.
iii) Write a C program to input any string from user and find the first
occurrence of a given character in the string.

You might also like