#include <stdio.h> #include <stdlib.h> /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char *argv[]) { int i,y=1,n; scanf("%d",&n); for(i=1;i<n;i++){ y=(y+1)*2; } printf("%d\n",y); return 0; } |
Double click to view unformatted code.