Sunday, March 24, 2013

Age in Days Calculator - C Language

TASK:
Write a program that takes age in years as input from the user and calcuates the age in days.

INPUT:

#include<stdio.h>
#include<conio.h>
void main(void)
{
clrscr();
int a,b,c;
printf("                   Age in Days Calculator");
printf("\n\nEnter your age in years:");
scanf("%d", &a);
b=365 ;
c=a*b;
printf("Your age in days is:%d", c);
printf("\n\nProgram Designed by: Geektist - (Shahrukh Hussain)");
getche();
}

OUTPUT:



Area of Circle Calculator - C Language

TASK:
Write a program to calculate the area of the circle, taking the radius as input from the user.

INPUT:
#include<stdio.h>
#include<conio.h>
void main(void)
{
clrscr();
float a,b,c,d;
printf("                                Area of Circle Calculator");
printf("Insert the radius of the circle:");
scanf("%f", &a);
b=a;
c=3.14915;
d=a*b*c;
printf("The area of your circle is:%f", d);
getche();
}

OUTPUT:


Sum, Product, and Average Calculator - C Language

TASK:
Write a program that takes four floating numbers as input from the user and prints their sum, product, and average. 

INPUT:
#include<stdio.h>
#include<conio.h>
void main(void)
{
clrscr();
float a,b,c,d,e,f,g;
printf("                            Sum, Product, and Average");
printf("\n\nInsert the 1st value:");
scanf("%f", &a);
printf("Insert the 2nd value:");
scanf("%f", &b);
printf("Insert the 3rd value:");
scanf("%f", &c);
printf("Insert the 4th value:");
scanf("%f", &d);
e=a+b+c+d;
printf("\nYour sum is:%f", e);
f=a*b*c*d;
printf("\nYour product is:%f", f);
g=e/4;
printf("\nYour average is:%f", g);
getche();
}

OUTPUT:

First 50 Even Numbers - C Language

TASK:
Write a program to generate a series of first 50 even numbers through loop.

INPUT:
#include<stdio.h>
#include<conio.h>
void main(void)
{
clrscr();
int i;
printf(" First 50 Even Number\n\n");
for (i=2;i<101;i+=2)
{
printf(" ");
printf("%d",i);
}
getch();
}

OUTPUT:



Saturday, March 23, 2013

Marksheet - C Language

TASK:
Write a program that takes input of five subjects' marks and calculate percentage of students.

INPUT:
#include<stdio.h>
#include<conio.h>
void main(void)
{
clrscr();
float a,b,c,d,e,f,g;
printf("                                               Marksheet");
printf("\n\nEnter the marks for English:");
scanf("%f",&a);
printf("Enter the marks for Mathematics:");
scanf("%f",&b);
printf("Enter the marks for Biology:");
scanf("%f",&c);
printf("Enter the marks for Physcis:");
scanf("%f",&d);
printf("Enter the marks for Chemistry:");
scanf("%f",&e);
f=a+b+c+d+e;
printf("\nTotal Marks Secured (Out of 500):%f",f);
g=f/500*100;
printf("\nTotal Percentage Secured:%f",g);
getch();
}

OUTPUT: