Advertisement
derazanother

p1.2

Jan 22nd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4.  
  5. int main() {
  6.     int num,i;
  7.     int x[5],*pn;
  8.     pn=x;
  9.     do{
  10.         printf("Input integer number: ");
  11.         scanf("%d",&num);
  12.    
  13.    
  14.     }while (num<1||num>99);
  15.     printf("Output: ");
  16.     for(i=0;i<num;i++){
  17.    
  18.         x[i] = num*(i+1);
  19.         *pn = x[i];
  20.         pn++;
  21.        
  22. }
  23. pn=x;
  24.     for(i=0;i<num;i++){
  25.         printf("%d",*pn);
  26.         pn++;
  27.    
  28.        
  29.        
  30. }
  31.  
  32.     return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement