Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

Cell Address:

For loop:
/* Source code to display table cells using nested for loop statement in C
programming. */
#include <stdio.h>
int main()
{
int alpha,code;
for(code=1;code<=7;code++) //initializing raw address
{
for(alpha='A';alpha<='G';alpha++) //initializing column address
{
printf("%c%d\t",alpha,code); //display cell address
}
putchar('\n'); /* end a line of text */
}
return 0;
}

While loop:
/* Source code to display table cells using nested while loop statement in C
programming. */
#include <stdio.h>
int main()
{
int alpha,code;
code=1; //initializing raw address
while(code<=7)
{
alpha='A'; //initializing column address
while(alpha<='G')
{
printf("%c%d\t",alpha,code); //display cell address
alpha++;
}
code++;
printf("\n"); // end a line of text
}
return 0;
}

Do While loop:
/* Source code to display table cells using nested while loop statement in C
programming. */
#include <stdio.h>
int main()
{
int alpha,code;
code=1; //initializing raw address
while(code<=7)
{
alpha='A'; //initializing column address
while(alpha<='G')
{
printf("%c%d\t",alpha,code); //display cell address
alpha++;
}
code++;
printf("\n"); // end a line of text
}
return 0;
}

Incremental-decremental operator:
#include <stdio.h>
int main()
{
int a,b;
b=16;
printf("Before, a is unassigned and b=%d\n",b);
a=b++;
printf("After postincrement operation, a=%d and b=%d\n",a,b);
b=16;
printf("Before, a is unassigned and b=%d\n",b);
a=++b;
printf("After preincrement operation, a=%d and b=%d\n",a,b);
b=16;
printf("Before, a is unassigned and b=%d\n",b);
a=b--;
printf("After postdecrement operation, a=%d and b=%d\n",a,b);
b=16;
printf("Before, a is unassigned and b=%d\n",b);
a=--b;
printf("After predecrement operation, a=%d and b=%d\n",a,b);
return 0;
}

You might also like