Thursday, July 30, 2009

Using turbo c what is the code when you are going to input number example 5 then the is output?

when you input a number for like example 5 then the output is like this:





1


2


3


4


5

Using turbo c what is the code when you are going to input number example 5 then the is output?
Just try this


#include%26lt;stdio.h%26gt;


void main()


{


int input,i;


printf("Enter the number");


scanf("%d",%26amp;input);


for(i=1;i%26lt;=input;i++)


{


printf("%d\n",i);


}


}
Reply:just try





for(i=1;i%26lt;=5;i++)


{


cout%26lt;%26lt;i;


}
Reply:for(i=1;i%26lt;=input;i++)


{


printf("%d\n",i);


}


No comments:

Post a Comment