Reginaldojs

exercicio 63,lista 3

Jun 17th, 2012
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #include<math.h>
  4. int main(){
  5.     int n,razao,a1,an;
  6.     printf("digite um numero inteiro positivo:\n");
  7.     scanf("%d",&n);
  8.     printf("Agora,digite o primeiro termo de sua PG\:\n");
  9.     scanf("%d",&a1);
  10.     printf("por favor,digite a razao:\n");
  11.     scanf("%d",&razao);
  12.     an=a1*pow(razao,n-1);
  13.     printf("o n-esimo termo desta PG sera %d\n",an);
  14.     system("pause");
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment