/**********************************************************************
**
Name: JadhavhAbhijithMahadev. hhhhhhhhhhhhhhhhhhhhhhRollhNo.:h3051.
Class:hF.Y.B.Sc.ComputerhScience.hhhhhhhhhhhhhhhhhhhhhhhhhhhhhBatchh:hC.
AssignmenthNo.:h1.
AssignmenthName:hWritehahChprogramhtohcalculatehareahandhperimeterhofhahhh
hhhhhhrectangle.
***********************************************************************
**/
#include<stdio.h>
main()
{
floathlength,breadth,height,area,perimeter;
printf("Enterhthehvalueshofhlengthhandhbreadthh:");
scanf("%f%f",&length,&breadth);
area=length*breadth;
printf("AreahofhRectangleh:%f\n",area);
perimeter=2*(breadth+height);
printf("PerimeterhofhRectangleh:%f\n",perimeter);
}
/********************hOutputh********************
[ctbora@localhosthfy]$hcchrec_area.c
[ctbora@localhosthfy]$h./a.out
Enterhthehvalueshofhlengthhandhbreadthh:4h6
AreahofhRectangleh:24.000000
PerimeterhofhRectangleh:12.000000
*************************************************/
/**********************************************************************
**
Name: JadhavhAbhijithMahadev. RollhNo.:h3051.
,Class:hF.Y.B.Sc.ComputerhScience.hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhBatchh:hC.
AssignmenthNo.:h2.
AssignmenthName:hWritehahChprogramhtohaccepthahcharacterhandhcheckhifhith
ishuppercasehorhlowercase.
********************************************************************
*/
#include<stdio.h>
main()
{
charhch;
printf("Enterhahcharacterh:");
scanf("%c",&ch);
if(isupper(ch))
{
printf("CharacterhishUppercase...\n");
}
else
{
printf("CharcaterhishLowercase...\n");
}
}
/*****************hOutputh******************
[ctbora@localhosthfy]$hgcchcharacter_case.c
[ctbora@localhosthfy]$h./a.out
Enterhahcharacterh:a
CharcaterhishLowercase...
[ctbora@localhosthfy]$h./a.out
Enterhahcharacterh:A
CharacterhishUppercase...
********************************************
/**********************************************************************
**
Name:JadhavhAbhijithMahadev. RollhNo.:h3051.
Class:hF.Y.B.Sc.ComputerhScience.hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhBatchh:hC.
AssignmenthNo.:h3.
AssignmenthName:hWritehahChprogramhtohaccepthtwohintegershfromhthehuserh
, andhinterchangehthem.Displayhthehinterchangedhnumbers.
********************************************************************
*/
#include<stdio.h>
main()
{
inthnumber1,number2,temp;
printf("Enterhnumber1handhnumber2h:");
scanf("%d%d",&number1,&number2);
printf("Beforehinterchangeh:hnumber1=%dhandhnumber2=%d\n",number1,nu
mber2);
temp=number1;
number1=number2;
number2=temp;
printf("Afterhinterchangeh:hnumber1=%dhandhnumber2=%d\n",number1,num
ber2);
}
/*******************hOutputh********************
[ctbora@localhosthfy]$hgcchinterchange.c
[ctbora@localhosthfy]$h./a.out
Enterhnumber1handhnumber2h:46h32
Beforehinterchangeh:hnumber1=46handhnumber2=32
Afterhinterchangeh:hnumber1=32handhnumber2=46
************************************************/
/**********************************************************************
**
Name: JadhavhAbhijithMahadev. RollhNo.:h3051.
Class:hF.Y.B.Sc.ComputerhScience.hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhBatchh:hC.
AssignmenthNo.:h4.
AssignmenthName:hWritehahChprogramhtohaccepththreehdimensionsh
length(l),breadth(b)handhheight(h)hofhahcuboidshandhprinth
surfacehareah(surfaceharea=2(lb+lh+bh)).
********************************************************************
*/
#include<stdio.h>
, main()
{
inthl,b,h,area;
printf("Enterhthehvalueshofhlength,breadthhandhheighth:");
scanf("%d%d%d",&l,&b,&h);
area=2*(l*b+l*h+b*h);
printf("SurfacehAreahofhCuboidh=%d",area);
}
/*********************hOutputh************************
[ctbora@localhosthfy]$hgcchcuboid.c
[ctbora@localhosthfy]$h./a.out
Enterhthehvalueshofhlength,breadthhandhheighth:2h3h4
SurfacehAreahofhCuboidh=52
******************************************************/
/**********************************************************************
**
Name: JadhavhAbhijithMahadev. RollhNo.:h3051.
Class:hF.Y.B.Sc.ComputerhScience.hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhBatchh:hC.
AssignmenthNo.:h5.
AssignmenthName:hWritehahChprogramhtohcheckhwhetherhthehgivenhyearhishleaph
orhnot.
********************************************************************
*/
#include<stdio.h>
main()
{
inthyear;
printf("Enterhyearh:");
scanf("%d",&year);
if(((yearh%h4h==h0)h&&h(yearh%h100h!=h0)h||h(yearh%h400h==h0)))
**
Name: JadhavhAbhijithMahadev. hhhhhhhhhhhhhhhhhhhhhhRollhNo.:h3051.
Class:hF.Y.B.Sc.ComputerhScience.hhhhhhhhhhhhhhhhhhhhhhhhhhhhhBatchh:hC.
AssignmenthNo.:h1.
AssignmenthName:hWritehahChprogramhtohcalculatehareahandhperimeterhofhahhh
hhhhhhrectangle.
***********************************************************************
**/
#include<stdio.h>
main()
{
floathlength,breadth,height,area,perimeter;
printf("Enterhthehvalueshofhlengthhandhbreadthh:");
scanf("%f%f",&length,&breadth);
area=length*breadth;
printf("AreahofhRectangleh:%f\n",area);
perimeter=2*(breadth+height);
printf("PerimeterhofhRectangleh:%f\n",perimeter);
}
/********************hOutputh********************
[ctbora@localhosthfy]$hcchrec_area.c
[ctbora@localhosthfy]$h./a.out
Enterhthehvalueshofhlengthhandhbreadthh:4h6
AreahofhRectangleh:24.000000
PerimeterhofhRectangleh:12.000000
*************************************************/
/**********************************************************************
**
Name: JadhavhAbhijithMahadev. RollhNo.:h3051.
,Class:hF.Y.B.Sc.ComputerhScience.hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhBatchh:hC.
AssignmenthNo.:h2.
AssignmenthName:hWritehahChprogramhtohaccepthahcharacterhandhcheckhifhith
ishuppercasehorhlowercase.
********************************************************************
*/
#include<stdio.h>
main()
{
charhch;
printf("Enterhahcharacterh:");
scanf("%c",&ch);
if(isupper(ch))
{
printf("CharacterhishUppercase...\n");
}
else
{
printf("CharcaterhishLowercase...\n");
}
}
/*****************hOutputh******************
[ctbora@localhosthfy]$hgcchcharacter_case.c
[ctbora@localhosthfy]$h./a.out
Enterhahcharacterh:a
CharcaterhishLowercase...
[ctbora@localhosthfy]$h./a.out
Enterhahcharacterh:A
CharacterhishUppercase...
********************************************
/**********************************************************************
**
Name:JadhavhAbhijithMahadev. RollhNo.:h3051.
Class:hF.Y.B.Sc.ComputerhScience.hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhBatchh:hC.
AssignmenthNo.:h3.
AssignmenthName:hWritehahChprogramhtohaccepthtwohintegershfromhthehuserh
, andhinterchangehthem.Displayhthehinterchangedhnumbers.
********************************************************************
*/
#include<stdio.h>
main()
{
inthnumber1,number2,temp;
printf("Enterhnumber1handhnumber2h:");
scanf("%d%d",&number1,&number2);
printf("Beforehinterchangeh:hnumber1=%dhandhnumber2=%d\n",number1,nu
mber2);
temp=number1;
number1=number2;
number2=temp;
printf("Afterhinterchangeh:hnumber1=%dhandhnumber2=%d\n",number1,num
ber2);
}
/*******************hOutputh********************
[ctbora@localhosthfy]$hgcchinterchange.c
[ctbora@localhosthfy]$h./a.out
Enterhnumber1handhnumber2h:46h32
Beforehinterchangeh:hnumber1=46handhnumber2=32
Afterhinterchangeh:hnumber1=32handhnumber2=46
************************************************/
/**********************************************************************
**
Name: JadhavhAbhijithMahadev. RollhNo.:h3051.
Class:hF.Y.B.Sc.ComputerhScience.hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhBatchh:hC.
AssignmenthNo.:h4.
AssignmenthName:hWritehahChprogramhtohaccepththreehdimensionsh
length(l),breadth(b)handhheight(h)hofhahcuboidshandhprinth
surfacehareah(surfaceharea=2(lb+lh+bh)).
********************************************************************
*/
#include<stdio.h>
, main()
{
inthl,b,h,area;
printf("Enterhthehvalueshofhlength,breadthhandhheighth:");
scanf("%d%d%d",&l,&b,&h);
area=2*(l*b+l*h+b*h);
printf("SurfacehAreahofhCuboidh=%d",area);
}
/*********************hOutputh************************
[ctbora@localhosthfy]$hgcchcuboid.c
[ctbora@localhosthfy]$h./a.out
Enterhthehvalueshofhlength,breadthhandhheighth:2h3h4
SurfacehAreahofhCuboidh=52
******************************************************/
/**********************************************************************
**
Name: JadhavhAbhijithMahadev. RollhNo.:h3051.
Class:hF.Y.B.Sc.ComputerhScience.hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhBatchh:hC.
AssignmenthNo.:h5.
AssignmenthName:hWritehahChprogramhtohcheckhwhetherhthehgivenhyearhishleaph
orhnot.
********************************************************************
*/
#include<stdio.h>
main()
{
inthyear;
printf("Enterhyearh:");
scanf("%d",&year);
if(((yearh%h4h==h0)h&&h(yearh%h100h!=h0)h||h(yearh%h400h==h0)))