Saturday, May 8, 2010
The A - Z of Friendship
Friends are like Stars .. you can't always see them, but you know they're always there.
The City Beautiful, Chandigarh, India
Chandigarh is aliased as The City Beautiful and it deserve to be. I knew this when I lived in Chandigarh for one month from Jan-10 to Feb-10 and it was a good experience. I have gone to many cities in India but I have never seen a city as well arranged as Chandigarh. The beauty is that every house in Chandigarh is of same structure and in a row. Chandigarh is divided in to many sectors starting from sector 1 to some sector 52-53. Each sector is having a residential area starting from A-D like 17C. Each residential sector is having its own market. There are two ISBT (Inter State Bus Terminus). One is in Sector 17(For Shimla, Ambala, Sonipath, Delhi route) and other is in sector 43(for Ludhiana, Amritsar, Jammu route). The city is very clean and roads are very nice. There are trees on the both side of the road. There is a separate track for walking people, cycles and rickshaws. One amazing thing, you know, there is not even a single flyover in the city but in spite of that you will never face traffic problem in the city. For this you have to praise the awesome traffic system of Chandigarh. This city has been ranked the best city to live in, by many magazines. The standard of living of this city is very high and as a result living in this city is little bit costly. Most of the people in Chandigarh are government employees, businessmen, or NRIs. All are rich.And no one is miser. You can see almost all luxurious cars there. Audi and Mercedes are common. Every body is having costly handsets and other gadgets. People of Chandigarh are very fashionable. They wear according to the current fashion. No simple hair style and beards will be visible. The city also attracts the drunkards because they can get Beer by spending ½ of bucks then what they pay in other cities. Whiskies, Scorch, Rum and other alcoholic liquid drinks are sometimes more cheaper ( ½ of cost or even less what you pay in other cities). I will rate this city as 9/10 in all aspects.
add to del.icio.us
saved by 0 users
Tuesday, May 4, 2010
Calculate the number of days between two dates using C
/*This program will ask for two date values in the formate of DD-MM-YYYY and produces the number of days between the two dates.This will not validate for any wrong entry for days(like more than 30-31) and months(like more than 12).However if you enter,you will get some unexpected result. If you need, with a few changes and little affords you can achieve your requirements.*/
add to del.icio.us
saved by 0 users
int count=0;int main()
{
int day1,day2,month1,month2,year1,year2,day11,month11,year11,year,month,day;
printf("Enter the privous date (DD) \n");
scanf("%d",&day1);
printf("Enter the privous month (MM) \n");
scanf("%d",&month1);
printf("Enter the privous year,for not being ambiguous input plz enter in YYYY format,else it will be a y2k bug\n");
scanf("%d",&year1);
printf("Enter the later date (DD)\n");
scanf("%d",&day2);
printf("Enter the later month (DD)\n");
scanf("%d",&month2);
printf("Enter the later year,for not being ambiguous input plz enter in YYYY format,else it will be a y2k bug\n");
scanf("%d",&year2);
day11=day1;
month11=month1;
year11=year1;
for(year=year11;year<=year2;year++)
{
for(month=month11;month<=12;month++)
{
if(year==year2 && month==month2)
{
countday(day11,day2);
break;
}
else
{
if(month==1 || month==3 || month==5 || month==7 || month==8 || month==10 || month==12) //These are the months having 31 days
{
countday(day11,31);
}
else if(month==4 || month==6 || month==9 || month==11) //These are the months having 30 days
{
countday(day11,30);
}
else if(month==2) //This is for february only
{
if((year%400==0) || (year%4==0 && year%100!=0)) //This is for checking a leap year
{
countday(day11,29);
}
else
{
countday(day11,28);
}
}
day11=1;
}
}
month11=1;
}
printf("The total number of days are : %d \n",count);
return 0;
}
//This function will start from the previous date and keep on counting each day as long as it come to the later date.
void countday(int ddin, int ddfnl)
{
int i;
for(i=ddin;i<=ddfnl;i++)
{
count++;
}
}
error: ‘for’ loop initial declarations are only allowed in C99 mode
Actually the complete error message will be like this.
error: ‘for’ loop initial declarations are only allowed in C99 mode,
note: use option -std=c99 or -std=gnu99 to compile your code
The one of many reason for this error message is, May be you have written a code like
The error is due to the declaration of variable i in the for loop. You have to declare the variable outside the for loop i.e.
And most probably your error message will not come. Try this.
For more detail you can visit http://gcc.gnu.org/c99status.html
add to del.icio.us
saved by 0 users
error: ‘for’ loop initial declarations are only allowed in C99 mode,
note: use option -std=c99 or -std=gnu99 to compile your code
The one of many reason for this error message is, May be you have written a code like
for(int i=0;i<=10;i++)
{
}
The error is due to the declaration of variable i in the for loop. You have to declare the variable outside the for loop i.e.
int i;
for(i=0;i<=10;i++)
{
}
And most probably your error message will not come. Try this.
For more detail you can visit http://gcc.gnu.org/c99status.html
Computer Training in Hyderabad
Dear friend,
add to del.icio.us
saved by 0 users
I have described about the Computer courses and their quality in Ameerpet,Hyderabad. As I am learning in Naresh i technology. I am going for JAVA and Oracle. But one thing I would like to say that please don't join this institute for Java at-least. The faculties are crap. They are spoiling my precious time. Satish Gupta (core java) is good in concepts but he take class for only 1 hours. And that's why he will take more time to complete the course. There is Mr. Naidu for Advance java. He is crap. Good in concepts but he does not like to teach. He will stress on those concepts which are of no use. He also take 1 hour of class and teaches only 30 minutes. Every one who comes here,have some fixed time to return. And these people do not understand this. Mr. Naidu will treat you like a KG student.For example let we have a method public void service (ServletRequest req, ServletResponse res) where req and res are reference variables of type ServletRequest and ServletResponse interface respectively. Now listen his silly questions. Can we write P in place of req and Q in place of res?? What are the changes we have to make in the program?? And can I give the variable name as some X,Y?? What are the changes we have to make??
And this is how he makes changes every day in all his programs. Even a student of class 6th-7th who solves words problems of linear equation will never confuse in these,because he knows that when he take a variable x and solves the equation, if he will assume it as y then how he will modify his steps and equations.If he comes to know that its 15 minutes left for the class to over, he will spend the rest time asking these type of silly questions.
I will advise you to join I-net Solve,I think that is good. How ever if you want to go for ORACLE then I will surely say to join Mr.Shatish Kumar Yallanki in Naresh i Technology.
Subscribe to:
Posts (Atom)