Breaking News

Category Archives: C program

Add digits of a number C PROGRAM

#include <stdio.h>   int main()  {   int n, sum = 0, remainder;     printf("Enter an integer\n");   scanf("%d", &n);     while (n != 0)   {     remainder = n % 10;     sum = sum + remainder;     n = n / 10;   }     printf("Sum of digits of entered number = %d\n", sum);     return 0; } OUTPUT Enter an integer 1659 Sum ... Read More »

Add ‘n’ numbers using array C PROGRAM

#include <stdio.h>   int main() {    int n, sum = 0, c, array[100];      printf("Enter the number of integers you want to add\n");    scanf("%d", &n);      printf("Enter %d integers\n",n);      for (c = 0; c < n; c++)    {       scanf("%d", &array[c]);       sum = sum + array[c];    }      printf("Sum = %d\n",sum);      return 0; } OUTPUT Enter the number of ... Read More »

Add ‘n’ numbers C PROGRAM

#include <stdio.h>   int main() {    int n, sum = 0, c, value;      printf("Enter the number of integers you want to add\n");    scanf("%d", &n);      printf("Enter %d integers\n",n);      for (c = 1; c <= n; c++)    {       scanf("%d",&value);       sum = sum + value;    }      printf("Sum of entered integers = %d\n",sum);      return 0; } OUTPUT Enter the ... Read More »

ASCII value of character C PROGRAM

#include <stdio.h> int main() {     char c;     printf("Enter a character: ");     scanf("%c",&c);     printf("ASCII value of %c = %d",c,c);     return 0; } OUTPUT Enter a character: A ASCII value of A = 65 Read More »

Addition of 2 matrix C PROGRAM

#include <stdio.h>   int main() {    int m, n, c, d, first[10][10], second[10][10], sum[10][10];      printf("Enter the number of rows and columns of matrix\n");    scanf("%d%d", &m, &n);    printf("Enter the elements of first matrix\n");      for (c = 0; c < m; c++)    {        for (d = 0; d < n; d++)        {            scanf("%d", &first[c][d]);        }            }      printf("Enter the elements ... Read More »

Addition and subtraction of two matrix program in C LANGUAGE

#include <stdio.h>   int main() {    int m, n, c, d, first[10][10], second[10][10], sum[10][10];      printf("Enter the number of rows and columns of matrix\n");    scanf("%d%d", &m, &n);    printf("Enter the elements of first matrix\n");      for ( c = 0 ; c < m ; c++ )       for ( d = 0 ; d < n ; d++ )          scanf("%d", &first[c][d]); ... Read More »

Scroll To Top