#include<stdio.h>You are the cause of my pain
You are the cause of my pain, yet the love I feel for you is my only consolation, my only cure..
Saw the girl, whom once I thought as my best friend
Remembering my classmates, after few years, My eyes were filled with tears, Everyone is busy a lot, No one escaped destiny's plot, Saw the girl, whom once I thought as my best friend, Today she is some body else's girl friend, After months remembered about her for a little while, Heard she is happy, that made me smile.
It’s been raining since you left me
It’s been raining since you left me, now I’m drowning in the flood. You see, I’ve always been a fighter, but without you I give up.
Sweet Heart
Sweetheart.....I miss ......THe whisper of your voice...The warmth of your touch and all the wonderful times that we shared together.......
When I see you
When I see you smile and know that it's not for me, that's when I miss you the most.
C PROGRAM TO REVERSE A NUMBER USING WHILE LOOP
TO FIND THE SUM OF DIGITS IN A FIVE DIGIT NUMBER
#include<stdio.h>void main(){int digit_1,digit_2,digit_3,digit_4,digit_5,sum,number,n;printf("Enter a five digit number");scanf("%d",&number);n=number;digit_1=n%10;n=n/10;digit_2=n%10;n=n/10;digit_3=n%10;n=n/10;digit_4=n%10;n=n/10;digit_5=n;sum=digit_1+digit_2+digit_3+digit_4+digit_5;printf("sum of digits=%d\n",sum);getch();}
How Use Loops in C-'DO WHILE' Loops
'DO WHILE' loops are useful for things that want to loop at least once.The syntax is:
do
{
Code to execute
}while(condition);
Example:#include<stdio.h>
int main()
{
int x;
x=0;
do
{/*"Hello World!" is printed at least one time even though the condition is false*/
printf("Hello World!");
}
while(x!=0);
getchar();
}
Notice that the condition is tested at the end of the block instead of beginning ,so the block will be executed at least once.If the condition is true,we jump back to the beginning of the block and execute it again.A DO WHILE loop is almost the same as WHILE loop except that the loop body is guaranteed to execute at least once.A WHILE loop says"Loop while the condition is true,and execute this block of code".A DO WHILE loop says"execute this block of code,and then continue to loop while the condition is true". Notice that this loop will execute once,because it automatically execute before checking the condition.<<Prev Home Next>>