Thursday, July 30, 2009

Can u please give me an example of for loop,int,string and char?? in turbo c?

i need more some examples ...... please help me... so that I can review much in my coming exam.....

Can u please give me an example of for loop,int,string and char?? in turbo c?
Integer


any numbers from 0 to 9 you can feed in a int variable.


eg:


int year; - contains the numbers


year=1990;





String


A group of alpha(A-Z and a-z), numeric(0-9) and special characters kept in a variable is string.


eg.


string date;


date="19.02.2006";





char


each and every position in a string contains a char.


char usually contains only one letter.


char date_seperator;


date_seperator="/";





for loop


to repeat a operation for defined number of times use for loop.


eg. to print date starting from 0-30





int date=0;


string month="June";


String year="1990"


char date_seperator ="/";








for (date=0;date%26lt;=30;i++)


{


printf(date+date_seperator+month+date_...


}








hope this helps you to understand better. :)

marguerite

No comments:

Post a Comment