36. Accept a Character from user and check if it is a lower case to convert yet into upper
case and vise versa.
Answer :
#include<stdio.h>
#include<conio.h>
Void main()
{
char ch, a;
clrscr();
printf("Enter any character");
scanf("%c", & ch);
if(ch>= 65 && ch<=91)
{
a = ch+32;
printf("Your character is %c", a);
}
else
{
a= ch-32;
printf("Your Character is %c", a);
}
getch();
}
_________________________________________________________________________________
37.
Answer :
#include<stdio.h>
#include<conio.h>
Void main()
{
int lower, upper;
printf("Enter the lower & upper limit");
scanf("%d%d", & lower, & upper);
while(lower<=upper)
{
printf(%d\t", lower);
lower++;
}
getch();
}
_________________________________________________________________________________
38. Accept a Number from user between 1 to 5 and print it in words.
Answer :
#include<stdio.h>
#include<conio.h>
Void main()
{
int num;
printf("Enter the Number between 1 to 5");
scanf(%d", & num);
if(num == 1)
printf("One");
else if(num == 2)
printf("Two");
else if(num == 3)
printf("Three");
else if(num == 4)
printf("Four");
else if(num == 5)
printf("Five");
else
printf("Number is out of range");
getch();
}
_________________________________________________________________________________
39. Write a Program to enter radius in any circle and find out diameter, area and circumference.
Answer :
#include<stdio.h>
#include<conio.h>
Void main()
{
float r,d,a,c;
const float pi=3.14;
printf("Enter Radius for the circle");
scanf("%f", &r);
d=2*r;
printf("Diameter is %f",d);
a=pi*r*r;
printf("Area of Circle is %f", a);
c=2*pi*r;
printf("Circumference is %f", c);
getch();
}
_________________________________________________________________________________
40. Write a Program to find simple Interest.
Answer :
#include<stdio.h>
#include<conio.h>
Void main()
{
float p=10000, r=2, t=2;
float si;
clrscr();
si=(P*R*T)/100;
printf("Simple Interest is %f", si);
getch();
}
*********************************************************************************
case and vise versa.
Answer :
#include<stdio.h>
#include<conio.h>
Void main()
{
char ch, a;
clrscr();
printf("Enter any character");
scanf("%c", & ch);
if(ch>= 65 && ch<=91)
{
a = ch+32;
printf("Your character is %c", a);
}
else
{
a= ch-32;
printf("Your Character is %c", a);
}
getch();
}
_________________________________________________________________________________
37.
Answer :
#include<stdio.h>
#include<conio.h>
Void main()
{
int lower, upper;
printf("Enter the lower & upper limit");
scanf("%d%d", & lower, & upper);
while(lower<=upper)
{
printf(%d\t", lower);
lower++;
}
getch();
}
_________________________________________________________________________________
38. Accept a Number from user between 1 to 5 and print it in words.
Answer :
#include<stdio.h>
#include<conio.h>
Void main()
{
int num;
printf("Enter the Number between 1 to 5");
scanf(%d", & num);
if(num == 1)
printf("One");
else if(num == 2)
printf("Two");
else if(num == 3)
printf("Three");
else if(num == 4)
printf("Four");
else if(num == 5)
printf("Five");
else
printf("Number is out of range");
getch();
}
_________________________________________________________________________________
39. Write a Program to enter radius in any circle and find out diameter, area and circumference.
Answer :
#include<stdio.h>
#include<conio.h>
Void main()
{
float r,d,a,c;
const float pi=3.14;
printf("Enter Radius for the circle");
scanf("%f", &r);
d=2*r;
printf("Diameter is %f",d);
a=pi*r*r;
printf("Area of Circle is %f", a);
c=2*pi*r;
printf("Circumference is %f", c);
getch();
}
_________________________________________________________________________________
40. Write a Program to find simple Interest.
Answer :
#include<stdio.h>
#include<conio.h>
Void main()
{
float p=10000, r=2, t=2;
float si;
clrscr();
si=(P*R*T)/100;
printf("Simple Interest is %f", si);
getch();
}
*********************************************************************************