C Programming Part A
C Programming Part A
#include <stdio.h>
#include <conio.h>
void main()
{
int rad;
float PI = 3.14, area, ci;
clrscr();
ci = 2 * PI * rad;
printf("\nCircumference : %f\n ", ci);
getch();
}
getch();
}
void main()
{
printf ("%f\n",sqrt(10.0));
printf ("%f\n",exp(4.0));
printf ("%f\n",log(4.0));
printf ("%f\n",pow(3,3));
getch();
}
printf ("Enter the number till which you want prime numbers\n");
scanf ("%d",&n);
#include<stdio.h>
#include<conio.h>
void main()
int n,m,rev,digit;
clrscr();
m = n;
rev = 0;
while(n!=0)
{
digit = n % 10;
n = n / 10;
rev = rev * 10 + digit;
}
if (m == rev)
else
getch();
#include<stdio.h>
#include<conio.h>
void main()
int value = 0;
int sum = 0;
clrscr();
while(sum != 999)
{
printf ("\nenter number:");
scanf ("%d", &value);
if (value == 999)
{
break;
}
else
{
sum = sum + value;
}
#include<stdio.h>
#include<conio.h>
void main ()
float m1,m2,m3;
float per,avg;
float total;
clrscr();
total= m1 + m2 + m3;
// Grade calculation
printf ("Fail\n");
getch();
#include <stdio.h>
#include<conio.h>
#include <math.h>
void main()
float a, b, c;
float discriminant;
clrscr();
/* Calculate discriminant */
discriminant = (b * b) - (4 * a * c);
switch(discriminant > 0)
case 1:
/* If discriminant is positive */
printf ("Two distinct and real roots exists: %.2f and %.2f",root1, root2);
break;
case 0:
switch(discriminant < 0)
case 1:
/* If discriminant is negative */
printf ("Two distinct complex roots exists: %.2f + i%.2f and %.2f - i%.2f",root1,
imaginary, root2, imaginary);
break;
case 0:
/* If discriminant is zero */
printf ("Two equal and real roots exists: %.2f and %.2f", root1, root2);
break;
getch();
#include<stdio.h>
#include<conio.h>
void main()
int n, i;
clrscr();
sum += num[i];
avg = sum / n;
getch();
#include<stdio.h>
#include<conio.h>
void main()
clrscr();
if(arr[i] == arr[j])
Size--;
j--;
printf ("\n Final Array after Deleteing Duplicate Array Elements is:\n");
getch();
#include<stdio.h>
#include<conio.h>
void main()
{
int n, m, c, d, first[10][10], second[10][10], sum[10][10], diff[10][10];
clrscr();
printf ("\nEnter the number of rows and columns of the first matrix \n\n");
scanf ("%d%d", &m, &n);
/* finding the SUM of the two matrices and storing in another matrix sum of the
same size */
/*finding the DIFFERENCE of the two matrices and storing in another matrix
difference of the same size */