Code 1

#include <stdio.h>

int main()

{

int a,b,c, sum;

float avg;

printf(“Please enter 3 numbers”);

scanf(“%d%d%d”,&a,&b,&c);

sum=a+b+c;

avg=(a+b+c)/3;

printf(“\nSum is %d”, sum);

printf(“\nAverage is %f”, avg);

return 0;

}

 

Code 2

#include <studio.h>

void main()

{

int i,x;

float f;

double p;

short s;

printf (“enter integer value\n”);

scanf (“%d”, &i);

printf (“enter float value\n”);

scanf (“%f”,&f);

p=i;

printf (“implicit values is %f\n”,p);

x= (int) f;

printf (“Explicit value is %d\n”, x);

}

Code 4

#include <stdio.h>
int main ()
{
int a,b;
printf(“please enter two different values\n”);
scanf(“%d%d”,&a,&b);
if(a>b)
{
printf(“%d is largest\n”,a);
}
else if (b>a)
{
printf(“%d is largest\n”,b);
}
return 0;
}

code 5

#include <stdio.h>

#include <conic.h>

printf (“Enter five subjects marks: “)

scanf (“%d%d%d%d%d”,&phy, &chem, &bio, &math, &comp);

printf (