When i run the program it shows the first line then blank i dont know whats wrong!

#include <cstdio>
#include "simpio.h"
#include "strlib.h"

int main()
{
	int i, d, t;

	printf("This program generates all perfect numbers from 1 to 100.\n");
	t = 0;
	for (i=1; i<=100; i++)
	{
		for (d=1; d<i; i++)
			{
				if(i%d==0)
				{
					t = d + t;
				}
			else;
			}
		if(t == i)
		{
			printf("%d\n",i);
		}
		else;
		t = 0;
	}
  system("pause");
}

if i=1 and d=1 would d<i execute? What do you say?

Would if(t == i) have a chance of being execute without t being initialized to any value?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.