Here's another one!

Write a program that will prompt you with "What number do you want the square of?", take an integer from the keyboard and tell you its square. The output should be of the form "The square of 2 is 4."
(4 marks)

Answer and marking scheme

#include<stdio.h> int main(void) { int x; printf("What number do you want the square of? "); scanf("%d",&x); printf("The square of %d is %d.\n",x,x*x); } 1 mark for remembering the semicolon after int x
1 mark for remembering the semicolon after
("What number do you want the square of? ")
1 mark for remembering the semicolon after
("%d",&x)
1 mark for remembering the semicolon after
("The square of %d is %d.\n",x,x*x)

And yet another one!