#include <iostream.h>
void main()
{
int c = 0 ;
do
cout<<++c<<" ";
while (c < 11 ) ;
}
------------------------------------------------
/* Program: The do-while loop */
#include <iostream.h>
#include<conio.h>
void main()
{
int x ;
do
{
cout<<"Enter any integer value :\n";
cin>>x ;
cout<<"Number : "<<x ;
cout<<"Square : "<<x*x ;
cout<<"Cube : "<<x*x*x ;
}
while (x != 0) ;
getch () ;
}
-------------------------------------------------
/* Program: The do-while loop */
#include <iostream.h>
#include <conio.h>
void main()
{
int num , temp ;
cout<<"Enter any integer value :\n";
cin>>num;
do
{
temp = num % 10 ;
cout<<temp ;
num = num / 10 ;
}
while (num != 0) ;
getch () ;
}
0 comments:
Post a Comment