Write a C program to perform the following tasks In main Inp
Solution
#include<stdio.h>
int doublenum(int x)// function that doubles the value of x
{
return 2*x;
}
void main()
{
int number,result;
printf(\"enter any integer\");//prompt to read a number
scanf(\"%d\",&number);// the input read through keyboard is stored at address of number
 result=doublenum(number);//function call
printf(\"the number after doubling:%d\ \",result);
}
output:
sh-4.3$ gcc -o main *.c
sh-4.3$ main
enter any integer9
the number after doubling:18
sh-4.3$

