Advertisement
Divyansh_Chourey

square and cube to infinity

Mar 11th, 2024
637
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.34 KB | Source Code | 0 0
  1. #include<stdio.h>
  2. int main(){
  3.     int i, n;
  4.     printf("Enter the value of n: ");
  5.     scanf("%d", &n);
  6.     printf("\n---------------------------------------------------");
  7.     i=1;
  8.     do{
  9.         printf("\n | \t %d \t | \t %d \t | \t %d \t |", i, i*i, i*i*i);
  10.         i++;
  11.     }while(i<=n);
  12.     printf("\n---------------------------------------------------");
  13.     return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement