Home Basic Loop Array string Function Pointer Contact STUDY

AHF    C    PROGRAM    SOLVING

Programming tips

Comment



Working with switch case



Header file



Iterative statement



Test expression




Print N natural number in a given range ( ascending way )




// AHF C PROGRAM SOLVING

//solving here ITERATIVES STATEMENTS type of programming problem

#include<stdio.h> #include<math.h> #define pf printf int main() { int n,m,j; //taking the number to continue loop as start point pf("Enter the first number: "); scanf("%d",&n); //taking the number to stop loop pf("\nEnter the second number: "); scanf("%d",&m); //printing from first to second number by increment one for(j=n;j<=m;j++) pf("%d ",j); return 0; }
OUTPUT:


© 2018 - All rights reserved