Sumita Arora Class --XI C++ Answer Programme code 01
If you have not Downloaded C++ turbo downlaod from this link
For Windows 7 and XP wether 64/32 Bit check this if showing error install dos box
https://docs.google.com/open?id=0B5n8JG_4DZBFNWtfQ01pTHd3ejQ
CHAPTER – 8 (BY: Harshit Yadav) (100%correct)
Q 28
//question 28 pg 246
#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{ clrscr();
unsigned
int n;
float x;
cout<<"Enter
the Base Value :";
cin>>x;
cout<<"\nEnter
the value of power :";
cin>>n;
cout<<"\nThe
Answer is :";
cout<<pow(x,n);
getch();
}
Q 29
//ques 29 page 246
#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{ float t,a;
clrscr();
cout<<"Enter
the principal amount:";
cin>>a;
cout<<"\nEnter
the time period is :";
cin>>t;
cout<<"\nThe
simple intrest according to the condition :";
cout<<((t>10)?((a*8*t)/100):((a*12*t)/100));
getch();
}
Q 30
//ques 31 pg 246
#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{ int n;
clrscr();
cout<<"Enter
The number :";
cin>>n;
cout<<"\nThe
answer according to condition :";
cout<<(((n%2)==1&&n==(unsigned)(int)n)?(sqrt(n)):(pow(n,5))
);
getch();
}
Q31
//ques 32 page 246
#include<iostream.h>
#include<conio.h>
void main()
{ float
r,i;
clrscr();
cout<<"Enter
the radius of the circle :";
cin>>r;
cout<<"\nEnter
your choice either 1 or 2 :";
cin>>i;
cout<<"\nThe
answer According to the logic is :";
cout<<((i==1)?(3.14*r*r):((i==2)?(2*3.14*r):(0)));
getch();
}
Q 32
//ques 33 pg 246
#include<iostream.h>
#include<conio.h>
void main()
{ clrscr();
int a,b,c;
cout<<"Enter
the first value :";
cin>>a;
cout<<"\nEnter
the second value :";
cin>>b;
cout<<"\nEnter
the third value :";
cin>>c;
cout<<"\nThe
greatest of all the three vlue is :";
cout<<((a>b)&&(a>c)?(a):((b>c)&&(b>a)?(b):(c)));
getch();
}
Q 34
//ques 34 pg 246
#include<iostream.h>
#include<conio.h>
void main()
{ int
ca=0,ha=0;
char c;
clrscr();
cout<<"enter
the your choice between a and b :";
cin>>c;
cout<<"\nYour
collage account balance is :";
cout<<((c=='a')?(ca+200):(0));
cout<<"\nYour
Hostel account balance is :";
cout<<((c=='b')?(ha+200):(0));
getch();
}
Q 35
//ques 35 pg 246
#include<conio.h>
#include<iostream.h>
void main()
{ clrscr();
char ch;
cout<<"Enter
the Character :";
cin>>ch;
(ch>=65&&ch<=90
|| ch>=97&&ch<=122)?((ch>=65&&ch<=90)?
cout<<"\nUpper
case :"<<ch<<"\n lower case :"<<(char)(ch+32):
cout<<"\nlower
case :"<<ch<<"\n upper case
:"<<(char)(ch-32)):
cout<<"\nNot
a Character :"<<ch;
getch();
}
8 comments:
Thanks bro... u r awesme
thakyu soo much dude!!!
Fine.pl.upload solutions for short anwer questions for all chapters.
awsm work done bro...... thankss sooo much
Awesome bro but couldn't understand last one.. help me
good
Thnx for these answers... 😘😘... Really i was stuck on these... Thnk u very much
Thank you so much.You are great.
Post a Comment