Skip to main content

Posts

Featured

Write a Program to find the average of n (n < 10) numbers using arrays

#include <stdio.h> int main () {      int marks [ 10 ], i , n , sum = 0 , average ;      printf ( "Enter n: " );      scanf ( "%d" , & n );      for ( i = 0 ; i < n ; ++ i )      {           printf ( "Enter number%d: " , i + 1 );           scanf ( "%d" , & marks [ i ]);           sum += marks [ i ];      }      average = sum / n ;      printf ( "Average = %d" , average );      return 0 ; } /* OUTPUT Enter n: 5 Enter number1: 45 Enter number2: 35 Enter number3: 38 Enter number4: 31 Enter number5: 49 Average = 39 */

Latest posts

Write a Program to find larger of three elements

Write a Program to Display Prime Numbers Between two Intervals

Write a Program to Check Prime and Armstrong Number

Write a Program to reverse a sentence entered by user without using strings

Write a Program Example to reverse a sentence entered by user without using strings.

Write a Program to read an array and search the element

Write a Program Using strcpy() function in Strings

Write a Program Using strcmp() function in Strings

Write a Program Using strlen() function for string

Write a Program Using gets() and puts() function in Strings