0% found this document useful (0 votes)
7 views2 pages

PracticeQuestions Loops-1

Practice questions loops in c

Uploaded by

naieemq111
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

PracticeQuestions Loops-1

Practice questions loops in c

Uploaded by

naieemq111
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

1. /* A Fibonacci sequence is defined as follows: the first and second terms in the sequence are 0 and 1.

Subsequent terms are found by adding the preceding two terms in the sequence. Write a C program to

generate the first n terms of the sequence. */

Fibonacci Series-> 0,1,1,2,3,5,8,11....

/* Write a C program to find the sum of individual digits of a positive integer. */

/* Write a C program, which takes two integer operands and one operator form the user, performs the

operation and then prints the result. (Consider the operators +, -, *, /, % and use Switch Statement)

/* Write a program(WAP) in C to find Factorial of a number*/

Factorial of 5= 5X4X3X2X1=12

Factorial of 4= 4X3X2X1=12

Factorial of 3=3X2X1=6

Factorial of 0 is 1

/* WAP Display Square of 100 natural numbers like this


1 1

2 4

3 9

4 16 */

/* WAP Display Cube of 100 natural numbers like this


1 1

2 8

3 27
4 64 */

/* WAP in c to display odd natural numbers from 1 to 100. Also print their sum and average */

/* WAP in c to display even natural numbers from 1 to 100. Also print their sum and average */

/* Write a C program to check whether a given number is an Armstrong number


or not.*/
Armstrong Number is that number whose sum of cubes of individual digits is
equal to actual number. For example
1 5 3= 1^3+ 5^3+3^3=1+125+27=153 hence 153 is an Armstrong Number
(^ means raised to power)

/*Write a program in C to display a given number in reverse order. */

/*Write a C program to check whether a number is a palindrome or not. *\


Palindrome number is that number which can same even if read in reverse
direction. For example, 121, 12321, 45654 etc
/* Write a program in C to convert a decimal number into binary without using an
array.*/

You might also like