Professional Documents
Culture Documents
These Programs Have Been Done in The Lab
These Programs Have Been Done in The Lab
**(*Program of an array to accept a list of numbers into 1-D array, find their sum, average and
display them.
#include<stdio.h>
#include<conio.h>
void main()
{
int n,i,p;
p=0;
clrscr();
for(i=2;i<n/2;i++)
{if(n%i==0)
p++;
}
if(p==0)
printf("%d is prime ",n);
else if(p!=0)
printf("%d is not prime ",n);
getch();
}
// Created on: 6th Apr'11
// Objective: To Print A Pattern Of Asterisks '*'
/* Comment: In this program we use 'for' to print
a 5 by 5 pattern of ASTERISK*/
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,rows,cols;
clrscr();
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,rows;
clrscr();