Tuesday, April 7, 2020
Home C Language looping statement

# looping statement

### Program to printing fibonacci series for first n terms

#include<stdio.h> #include<conio.h> void main() { int n,i; long f0=0,f1=1,f2; clrscr(); printf("n enter nn"); scanf("%d", &n); printf("n Fibonacci series up to %d terms n", n); for(i=1;...

### Program to finding factorial of a number

#include<stdio.h> #include<conio.h> void main() { int n,i; double f=1; clrscr(); printf("n Enter nn"); scanf("%d", &n); for(i=1;i<=n;++i) f=f*i; ...

### Program to finding sum of 1/2+2/3+3/4+………….n/n+1

#include<stdio.h> #include<conio.h> void main() { int n,i; float s=0; /* s for sum which is a float value as division occurs */ clrscr(); printf("n Enter nn"); ...

### Program to finding sum of 1 to n

#include<stdio.h> #include<conio.h> void main() { int n,i; long s=0; /* n for given number, s for sum */ clrscr(); printf("n Enter n n"); ...

### Program to print multiplication table for any given number

#include<stdio.h> #include<conio.h> void main() { int i,n; /* i for loop counter, n for given number for which, we have print ...

### Program to print all even numbers from m to n using for loop

#include<stdio.h> #include<conio.h> void main() { int i, n, m; /* i for loop counter, m is lower limit, n for upper limit */ clrscr(); printf("n...

### Program to print all odd numbers from m to n using for loop

#include<stdio.h> #include<conio.h> void main() { int i,n,m; /* i for loop counter, m is lower limit, n for upper limit */ clrscr(); printf("n...

### Program to print all numbers from m to n using for loop

#include<stdio.h> #include<conio.h> void main() { int i,n,m; /* i for loop counter, m is lower limit, n for lower limit */ clrscr(); printf("n Enter lower limit...

### Program to print 1 to n numbers using for loop

#include<stdio.h> #include<conio.h> void main() { int i,n; /* i for loop counter, n for the extreme boundary */ clrscr(); printf("n Enter the upper limitn"); scanf("%d",&n); printf("n...

#### Stay connected

19,095Fans
2,043Followers
14,700Subscribers

### Python program to find largest of three numbers

num1=int(input("Please enter first number: ")) num2=int(input("Please enter second number: ")) num3=int(input("Please enter third number: ")) if((num1>num2)and(num2>num3)): # use of logical and, which gives true only when...

### Python program to check a number is positive negative or zero

num=int(input("Please enter a number to check Positive Negative or Zero ")) if(num>0): print("Given number is a positive number"); elif(num<0): print("Given number is...

### Python program to check given number is even or odd

num=int(input("Enter a number to check even or odd ")) if(num%2==0): # checks for remainder is zero or not for even number it should be 0 ...