View Code of Problem 73

#include<stdio.h>
main()
{
    int x=1,n;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    	x=(x+1)*2;
    printf("%d",x);
}
/*
Main.c:2:1: warning: return type defaults to 'int'
 main()
 ^
Main.c: In function 'main':
Main.c:6:9: error: 'i' undeclared (first use in this function)
     for(i=0;i<n;i++)
         ^
Main.c:6:9: note: each undeclared identifier is reported only once for each function it appears in
*/

Double click to view unformatted code.


Back to problem 73