Question 11
#include <stdio.h>
int fun(int n)
{
static int s = 0;
s = s + n;
return (s);
}
int main()
{
int i = 10, x;
while (i > 0)
{
x = fun(i);
i--;
}
printf (\"%d \", x);
return 0;
}
Question 12
#include <stdio.h>
int a, b, c = 0;
void prtFun (void);
int main ()
{
static int a = 1; /* line 1 */
prtFun();
a += 1;
prtFun();
printf ( \"\\n %d %d \" , a, b) ;
}
void prtFun (void)
{
static int a = 2; /* line 2 */
int b = 1;
a += ++b;
printf (\" \\n %d %d \" , a, b);
}
Question 13
#include <stdio.h>
int main()
{
register int i = 10;
int *ptr = &i;
printf(\"%d\", *ptr);
return 0;
}
Question 14
#include <stdio.h>
int main()
{
extern int i;
printf(\"%d \", i);
{
int i = 10;
printf(\"%d \", i);
}
}
Question 15
#include <stdio.h>
int main(void)
{
int i = 10;
const int *ptr = &i;
*ptr = 100;
printf(\"i = %d\\n\", i);
return 0;
}
Question 16
#include <stdio.h>
char *fun()
{
static char arr[1024];
return arr;
}
int main()
{
char *str = \"geeksforgeeks\";
strcpy(fun(), str);
str = fun();
strcpy(str, \"geeksquiz\");
printf(\"%s\", fun());
return 0;
}
Question 17
#include <stdio.h>
int f(int n)
{
static int r = 0;
if (n <= 0) return 1;
if (n > 3)
{
r = n;
return f(n-2)+2;
}
return f(n-1)+r;
}
int main()
{
printf(\"%d\", f(5));
}
Question 19
typedef int INT, *INTPTR, ONEDARR[10], TWODARR[10][10];
Question 20
There are 31 questions to complete.