#include<stdio.h>
#include<conio.h>
main()
{
int i,k;
clrscr();
printf("How many do you want to display:");
scanf("%d",&i,k);
for(i=2;i<=30;i+=2){
for(k=1;k<=30;k+=2){
printf("\nThe number %d:%d",i,&k);
}
}
getch();
}
You have a loop inside a loop. That means that, for a single value of i, you will loop over 30 values of k. Then for the next value of i, you loop another 30 times over the inner loop. I don't think that's what you want to do. Try thinking more clearly about the logic, before turning it into C++ code.