The document contains snippets of code and descriptions for various programming challenges including: displaying patterns like triangles and stars using loops, calculating the first 8 Fibonacci numbers, interchanging values without a third variable, finding the smallest of three numbers, checking if a number is divisible by 10, calculating average age from student ages, and applying a 10% discount to a bill amount.
1 of 1
Download to read offline
More Related Content
Assignement code
1. /*Write a program that generates the following output using a single nested loop
$
##
$$$
#### */
---------------------------------
/*Show 1st 8 FIBONACCI Number *
--------------------------------
/*Write a program that input two number interchange the value of and then
display them without using third variable.*/
------------------------
/*Show out
****
***
**
* */
------------------------
Triangle */
---------------------
/*Take input of Three n.o if the are not Equal,then find the Smallest n.o*/
Take input of two n.o if 2nd n.o is greater than 1st,display the division
as follow i.e. 1st=16 2nd=5 Ans=5*3+1=16*/
-------------------------
/*Show out
*/
-----------------------
Show out
*
**
***
**** */
-------------------
/*Take input a n.o and find if it is divisible by 10 or not*
---------------------
/* d=++a + a-- - b++ + --c = 1*/
----------------------------
SUM OF 1ST 6TH PRIME NUMBER*/
------------------------------
entr 10 student age and show average age*/
---------------------------
Enter The Amount Of The Bill And Discount At The Rate Of 10% */
----------------------------------