CBSE Class 10 Computer Science C program to illustrate use of function with argument and return value

//program to illustrate use of function with argument and return value
#include<stdio.h>
int sqr(int); //function declaration
void main()
{
int number, result;
printf("\n Enter your number = ");
scanf("%d", &number);
result=sqr(number); //function call
printf("\n the square of %d is %d", number,result);
}
int sqr(int num1) //function definition
{
int answer;
answer=num1*num1;
return(answer);
}

Tags: 

 


Click for more Computers Study Material
CBSE Class 10 Computer Science C program to find simple interest
CBSE Class 10 Computer Science C program to print odd numbers between given numbers
CBSE Class 10 Computer Science C Program to display area and circumference of circle
CBSE Class 10 Computer Science C program to find addition subtraction and multiplication using switch
CBSE Class 10 Computer Science C program to convert meter into millimeter
CBSE Class 10 Computer Science C program to print table of given number
CBSE Class 10 Computer Science C Program to display area and perimeter of rectangle
CBSE Class 10 Computer Science C program for Addition Subtraction and Division using Else If ladder
CBSE Class 10 Computer Science C program to convert Fahrenheit into Celsius
CBSE Class 10 Computer Science C program of addition(function with return type and with arguments)
CBSE Class 10 Computer Science C Program to display area and perimeter of square
CBSE Class 10 Computer Science C program of array for theory only
CBSE Class 10 Computer Science C program to find average of five subjects
CBSE Class 10 Computer Science C program to illustrate use of function which return no value
CBSE Class 10 Computer Science C program to display volume of cuboid
CBSE Class 10 Computer Science C program to print series using for loop
CBSE Class 10 Computer Science C program to find whether a given no is divisible by another number or not
CBSE Class 10 Computer Science C program to illustrate use of function with argument and no return value
CBSE Class 10 Computer Science C program to find volume of sphere
CBSE Class 10 Computer Science C program to print series using while loop
CBSE Class 10 Computer Science C Program To Display Your School Name Address
CBSE Class 10 Computer Science C program to find student is pass or fail
CBSE Class 10 Computer Science C program to illustrate use of function with argument and return value
CBSE Class 10 Computer Science C program to find volume of cylinder
CBSE Class 10 Computer Science C program to print series using do-while loop
CBSE Class 10 Computer Science C Program to display first letter of your name
CBSE Class 10 Computer Science C program to find person is eligible for voting or not

Latest NCERT & CBSE News

Read the latest news and announcements from NCERT and CBSE below. Important updates relating to your studies which will help you to keep yourself updated with latest happenings in school level education. Keep yourself updated with all latest news and also read articles from teachers which will help you to improve your studies, increase motivation level and promote faster learning

CBSE Class 10 Revised Syllabus

Last year CBSE had to reduce the syllabus because of the pandemic situation but it was not very effective because there were no examinations. This year to avoid any confusion and conflict, CBSE has decided to reduce the syllabus into term 1 and term 2. 50 percent of...

CBSE OMR Sheet Guidelines for Term 1

You are aware that the CBSE will be using OMR for the first time for assessment of both the Classes-X and XII in Term-I examinations. Hence, there is a need that all the students appearing in the Term-l examinations and the schools sponsoring these students should have...

CBSE Reading Challenge

The acquisition of 21st century competencies of communication, critical and creative thinking and the ability to locate, understand and reflect on various kinds of information has become more crucial for our learners. It is well accepted that Reading Literacy is not...

×
Studies Today