History, asked by naseerhussain15, 1 year ago

c program to write prime numbers up to given range and print in alphabets

Answers

Answered by Róunak
1
#include <stdio.h>

#include <math.h>

void main()

{

        int num,m,n,d; 

        clrscr();

        printf("Enter the Range Between m,n ");

        scanf("%d%d", &m,&n);

       for (num = m; num <= n; num++)

            {

               for(d = 2; d < num; d++)

                {

                   if (num % d == 0)

                      break;

                }

                   if (d == num)

                      printf("%d ", num);

            }

                                     getch();

}

Answered by viji18net
0

Answer:

string = input("Please enter your own String : ")  

char = input("Please enter your own Character : ")  

count = 0  

for i in range(len(string)):  

 if(string[i] == char):  

   count = count + 1  

print("The total Number of Times ", char, " has Occurred = " , count)

Similar questions