#include<iostream.h>
#include<conio.h>
void main()
{
int months[11]={31,31,30,31,30,31,31,30,31,30,31};
int fab;
cout<<"How much Days in Fab this year = "; cin>>fab;
int i=0;
int *ptr;
while(i<=11)
{
fab=fab+months[i];
ptr=&fab;
i++;
}
cout<<"total Days this Year Will be = "<<fab;
getch();
}
output :-
#include<conio.h>
void main()
{
int months[11]={31,31,30,31,30,31,31,30,31,30,31};
int fab;
cout<<"How much Days in Fab this year = "; cin>>fab;
int i=0;
int *ptr;
while(i<=11)
{
fab=fab+months[i];
ptr=&fab;
i++;
}
cout<<"total Days this Year Will be = "<<fab;
getch();
}
output :-