View Code of Problem 31

#include<stdio.h>
int main(){
	long int k, sum;
	while(~scanf("%d",&k)){
		num = 23 + 3 * 5 * 7 * (k - 1); 
		printf("%ld\n",sum);
	}
	return 0;
}
/*
Main.c: In function 'main':
Main.c:4:17: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'long int *' [-Wformat=]
  while(~scanf("%d",&k)){
                ~^  ~~
                %ld
Main.c:5:3: error: 'num' undeclared (first use in this function); did you mean 'sum'?
   num = 23 + 3 * 5 * 7 * (k - 1);
   ^~~
   sum
Main.c:5:3: note: each undeclared identifier is reported only once for each function it appears in
*/

Double click to view unformatted code.


Back to problem 31