C program to find sum of integers between 1 and 100 which are divisible by 3 and 5

To Do:

15 + 30 + …. + 90

Program:

#include<stdio.h>
#include<conio.h>
void main()
{
int i = 2;
int sum = 0;
clrscr();
while(i <= 99)
{
if ((i%3 == 0) && (i%5 == 0))
{
printf(“%d\n”, i);
sum = sum + i;
}
i++;
}
printf(“The sum is %d”, sum);
getch();
}

C program to convert character to ASCII and to find the sum of digits of ASCII value

Program:

#include<stdio.h>
#include<conio.h>
#include<ctype.h>
void main()
{
 char ch;
 int asc;
 int sum = 0;
 clrscr();
 printf("Enter a character : ");
 scanf("%c", &ch);
 asc = toascii(ch);
 printf("\nThe ASCII value of %c is %d", ch, asc);
 while (asc > 0)
 {
  sum = sum + (asc % 10);
  asc = asc / 10;
 }
 printf("\nThe sum is %d", sum);
 getch();
}

C program to find sum of integers between 101 to 200 whose individual digits are prime in nature

#include<stdio.h>
#include<conio.h>

void main()
{
 int i=102, j, k;
 int sum = 0, digitsum;
 int prime;
 clrscr();
 do
 {
  j = i;
  digitsum = 0;
  while (j > 0)
  {
   digitsum = digitsum + (j % 10);
   j = j / 10;
  }
  prime = 1;
  for (k=2; k<digitsum/2; k++)
  {
   if (digitsum % k == 0)
   {
    prime = 0;
    break;
   }
  }
  if (prime == 1)
  {
   sum = sum + i;
  }
  i++;
 } while (i < 200);
 printf("Sum is %d", sum);
 getch();
}