Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <ctype.h>
- #include <string.h>
- int tabuada_for(int n)
- {
- printf("TABUADA FOR\n");
- int temp=0;
- for(int i=1;i<=10;i++)
- {
- temp = n * i;
- printf("%d x %d = %d\n", i, n, temp);
- }
- return 0;
- }
- int tabuada_while(int n)
- {
- printf("TABUADA WHILE\n");
- int temp=0, i=1;
- while(i <= 10)
- {
- temp = n * i;
- printf("%d x %d = %d\n", i, n, temp);
- i++;
- }
- return 0;
- }
- int tabuada_do_while(int n)
- {
- printf("TABUADA DO WHILE\n");
- int temp=0, i=1;
- do
- {
- temp = n * i;
- printf("%d x %d = %d\n", i, n, temp);
- i++;
- }
- while(i <= 10);
- return 0;
- }
- int main(void)
- {
- int x, y, z;
- printf("Valor pra tabuada for: \n");
- scanf("%d", &x);
- printf("Valor pra tabuada while: \n");
- scanf("%d", &y);
- printf("Valor pra tabuada do while: \n");
- scanf("%d", &z);
- printf("\n");
- tabuada_for(x);
- printf("\n");
- tabuada_while(y);
- printf("\n");
- tabuada_do_while(z);
- printf("\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement