In this session, you will do the practice questions of Chapter 1 and Chapter 2. Objectives
Write a function to accept a character and display it 40 times. Write a function that accepts a number from 0 to 9, along with a string. The string should then be displayed the number of times specified. Chapter 1
1. Write a for loop, which will produce the following output (Hint: use two nested for loops): 1 22 333 4444 55555 Create a C program, which calculates the triangular number of the user’s request, read from the keyboard using scanf(). A triangular number is the sum of the preceding numbers, so the triangular number 7 has the value of 7+6+5+4+3+2+1 (same as a factorial in mathematics, for example, factorial of 7 ---- !7). Chapter 2
Create a C program to check whether the number entered by user is even or odd. Chapter 2

C programming session 03

  • 1.
    In this session,you will do the practice questions of Chapter 1 and Chapter 2. Objectives
  • 2.
    Write a functionto accept a character and display it 40 times. Write a function that accepts a number from 0 to 9, along with a string. The string should then be displayed the number of times specified. Chapter 1
  • 3.
    1. Write afor loop, which will produce the following output (Hint: use two nested for loops): 1 22 333 4444 55555 Create a C program, which calculates the triangular number of the user’s request, read from the keyboard using scanf(). A triangular number is the sum of the preceding numbers, so the triangular number 7 has the value of 7+6+5+4+3+2+1 (same as a factorial in mathematics, for example, factorial of 7 ---- !7). Chapter 2
  • 4.
    Create a Cprogram to check whether the number entered by user is even or odd. Chapter 2

Editor's Notes

  • #2 Begin the session by explaining the objectives of the session.