MS Rumi. Powered by Blogger.
Showing posts with label int variable. Show all posts
Showing posts with label int variable. Show all posts

Friday, 25 April 2014

Loop in C++ 1 to 40 numbers

Nested For Loop In C++ 

Use for loop to print number (1 to 40)  5 on a line.

#include<iostream.h>
void main ()
{
int num=1;
for(int i=1; i<=8; i++)
{
for(int j=1; j<=5; j++)
{
cout<<num;
num++;
}
cout<<endl;
}

}


OutPut



Thursday, 24 April 2014

Program To Print Small Letters

C++ Program To Print a To z

Write a program to print the small letters from (a → z) in c++.

// You can use same program for the Capital latter replace small 'a' with capital 'A'.
#include<iostream.h>
void main ()
{
char ch='a';
for(int i=1;i<=26;i++)
{
cout<<ch<<",";
ch++;
}

}

E-mail Newsletter

Sign up now to receive breaking news and to hear what's new with us.

Recent Articles

TOP