Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program to let you type in a group of numbers you also need to type many

ID: 3673942 • Letter: W

Question

Write a program to let you type in a group of numbers you also need to type many numbers you will type in), and calculate the range of these numbers Write a program to print the prime number from 1 to 100.(A prime integer is any integer that can be divided evenly only by itself and 1) Write a program to print the prime number from 1 to 100.(A prime integer is any integer that can be divided evenly only by itself and 1) Requirement an array to take the number from 1 to 100 and another array to take the prune number Write a C code to perform the following tasks: In main: Define an array of Sin and initialize them with 3.5.7.9.11.13.15 Call function turn with the array and site as parameters Print each element of the array Print the sum In function sum: Use for loop to calculate sum Write a C code to perform the following tasks: in main Define an array of Sin - 7 and initialize them with 3.S.7.9.11.13.15 Call function sum with the array and site, both passed in pointer representations Print each element of the array Print the sum In function sum: Take the parameters m pointer representations. Use for loop to calculate sum Define two arrays x and f. each of site 10. to pass the array to a function, named sum In main: define array, pass arrays, print out the array and the results on screen In function sum. take arrays from main and sum the arrays using the formula below Define two arrays x and f. each of site 10. using call-by-reference (that is. use pointers), to pass the array to a function, named sum. In main: define array, pass arrays, print out the array and the results on screen In function sum. take arrays from main and sum the arrays using the formula below

Explanation / Answer

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

void main()
{
   int n, a[100],i,max,min=0;

   printf("Enter number of number to be entered");
   scanf("%d",&n);

   for(i=0;i<n;i++)
   {
       printf("Enter %d number"i+1);
       scanf("%d",&a[i]);
   }
   max=a[0];
   for(i=0;i<n;i++)
   {
       if(a[i]<min)
           min=a[i];

       if(a[i]>max)
           max=a[i];
   }
  
   printf("Range of numbers is %d to %d",min, max);
   getch();
}

2.

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

void main()
{
   int a,i,c,j;

   clrscr();

   for(i=1;i<=100;i++)
   {
       for(j=2;j<=i-1;j++)
       {
           c=i%j;

           if(c==0)
           {
               break;
           }
       }
       if(i==1 || i==j)
       {
           printf(" %d",i);
       }
   }
   getch();
}

3.


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

void main()
{
   int a[100],p[100],i,c,j,k=0;

   clrscr();
  
   for(i=0;i<100;i++)
       a[i]=i+1;
      
  
   for(i=1;i<=100;i++)
   {
       for(j=2;j<=i-1;j++)
       {
           c=a[i]%j;

           if(c==0)
           {
               break;
           }
       }
       if(i==1 || i==j)
       {
           b[k]=a[i];
           k++;
       }
   }
   for(i=0;i<k;i++)
       printf(" %d",b[i]);
  
   getch();
}

4.

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

void sum(int a[], int s)
{
   for(i=0;i<s;i++)
   {
       printf(" %d",a[i]);
       sum1=sum1+a[i];
   }
   printf("Sum of numbers is %d",sum1);
   getch();
}


void main()
{
   int const SIZE=7, a[]={3,5,7,9,11,13,15};
   sum(a,SIZE);
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote