Exercises 1. Write a program in \( \mathrm{C} \) to display natural numbers from 1 to \( \mathrm{n} \) and their sum. 2. Write a \( \mathrm{C} \) program to compute the sum of the first 10 natural numbers. 3. Write a C program to display the cube of the number from 1 up to \( n \). 4. Write a \( \mathrm{C} \) program to display the first \( \mathbf{5 0} \) natural numbers. 5. Write a \( \mathrm{C} \) program to display the multiplication table for a given integer. 6. Write a \( \mathrm{C} \) program to display the odd natural numbers between 1 and 50 and their sum. 7. Write a \( \mathrm{C} \) program to display a pattern like a right angle triangle using an asterisk. The pattern like : 8. Write a C program to display a pattern like a right angle triangle with a number. The pattern like : 1 12 123 1234 9. Write a program in \( \mathrm{C} \) to make such a pattern like a right angle triangle with the number increased by 1. The pattern like : 1 23 456 \( \begin{array}{lll}7 & 89 & 10\end{array} \)
Added by Bananeza A.
Close
Step 1
Program to display natural numbers from 1 to n and their sum: ```c #include<stdio.h> int main(){ int i, n, sum=0; printf("Enter a number: "); scanf("%d", &n); for(i=1; i<=n; i++){ printf("%d ", i); sum += i; } printf("\nSum Show more…
Show all steps
Your feedback will help us improve your experience
Anecia Mcmurrin-Bala and 65 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
'Write C++ program to print sum of 10 natural numbers'
Rabeya Z.
'Write a Ct+ program to take input a value from user and print sum of first n natural numbers.'
Chandra J.
Write a program in C++ to calculate sum of odd numbers from 1 to 50.
Willis J.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Watch the video solution with this free unlock.
EMAIL
PASSWORD