Академический Документы
Профессиональный Документы
Культура Документы
INDEX
Acknowledgements
Programs:
1. Addition of Two Integers
2. Count Till
3. Average Marks of 5 Students
3. Area of Circle
4. Difference of Two Integers
5. All Even Numbers from 2 to 40
6. Roots of a Quadratic equation
7. All Odd Numbers less than 50
8. Highest Common Factor of Two Integers
9. Lowest Common Multiple of Two Integers
10. Even Number or Odd Number
11. Prime Number
12. Multiples of any Natural Number up to 100
13. Factors of a Number
14. Multiplication Table of a Number
15. Number Pyramid
16. Star Pyramid
17. Check Whether a Triangle is Equilateral,
Isosceles or Scalene
18. Addition, Subtraction, Multiplication, Division of
ACKNOWLEDGMENT
Output:
Output:
Output:
cout<<i;
i=i+2;
cout<<endl;
Output:
10
if(D<0)
cout<<"No real roots"<<endl;
else if(D==0)
{
cout<<"Equal and real roots"<<endl;
r1= -b/(2*a);
cout<<"Roots of Given Equation: "<<r1<<endl;
}
else
{
11
Output:
12
while(odd<50)
{
cout<<odd<<endl;
odd=odd+2;
}
Output:
13
}
cout<<"HCF of "<<no1<<" and "<<no2<<" is: "<<HCF;
14
Output:
15
16
Output:
17
}
Output:
18
}
if (prime==1)
cout<<x<<" is not a Prime Number.";
else
cout<<x<<" is a Prime Number.";
19
Output:
20
y++;
Output:
21
y--;
}
Output:
22
divisor++;
}
Output:
23
Output:
24
}
Output:
25
}
else if(side1==side2 || side2==side3 || side1==side3) //'||' stands for 'or'
{
cout<<"Two sides are Equal."<<endl;
cout<<"It is an Isosceles Triangle!";
}
else if(side1!=side3 && side2!=side3 && side1!=side2)
{
cout<<"No sides are equal."<<endl;
cout<<"It is a Scalene Triangle!";
}
26
Output:
27
28
Output:
29
30
Output:
31
}
Output:
32
33
Output:
34
35
Output:
36
37
Output:
38
cout<<":::PALINDROME:::"<<endl;
cout<<endl;
cout<<"Enter String: ";
gets(str);
len=strlen(str);
//Length of string
j=len-1;
for(i=0 ; i<(len/2) ; i++)
{
if (str[i]==str[j])
{
flag=1;
}
else
flag=0;
j--;
}
if(flag==1)
cout<<"The given string is a palindrome.";
else if(flag==0)
cout<<"The given string is not a palindrome.";
39
Output:
40
Output:
41
cout<<endl;
cout<<"Length of String= "<<length;
Output:
42
43
Output:
44
}
cout<<"Number of Spaces= "<<count;
cout<<endl;
count=count+1;
cout<<"Number of Words= "<<count;
}
45
Output:
46
cout<<str[i]<<".";
for( ; str[i]!=' ' ; i++)
i=i+1;
47
Output:
48