#include<stdio.h>int main( ) { float number,square; printf("Enter any integer value :"); scanf("%f", &number); square=number*number; printf("square of a given number%.2f is=%.2f", number, square); return 0;}
#include <stdio.h>void square(){ int x,square; printf("enter the number:"); scanf("%d",&x); square=x*x; printf("square of the number is=%d",square);} int main(){ square();}ByJ.puja ShreeECE department irtt
#include int main() { float number, square; printf("Please Enter any integer Value:); scanf("%f", &number); square number number; printf("square of a given number %.2f is =%.2f", number, square); return 0; } ByGokulapriya MEce department irtt
#include<stdio.h>int main(){ float number, square; printf("Enter any integer Value:"); scanf("%f", &number); square=number* number; printf("square of a given number %.2f is = %.2f", number, square); return 0;}ByRanish. TIT departmentIRTT
While doing function ising parameters, Pls tell what is the signifine of giving int as return type for main()? Can't we use void main()?
#include<stdio.h>int main(){ float number, square; printf("Enter any integer Value:"); scanf("%f", &number); square=number* number; printf("square of a given number %.2f is = %.2f", number, square); return 0;}ByPooja.N.LECE departmentIRTTC-and-Cpp Functions 03
How function can return a value without writing return statement in its definition?help me out pls
there is no return function in function definition . how can it return from definition to calling function
I have question whenever we use int main() we have to return zero at the end and according to definition default value of main function is integer. Why it is not giving error in compilation in gcc compiler ? as it is mandatory to return zero at the end but it works properly. Even int main() also working without return(0).
I was trying to run the "Function with parameters" program displayed at the online video using TurboC(I typed a exactly same program shown in the video). But, it wasn't compiling/running and produced following error,Error#1 - Function should return a value,Error#2 - "c" is assigned a value that is never used.However, it was compiling/running successfully when the same program ran at minGW. Why was it not compiling/running at TurboC? Can i continue use TurboC?
for gcc compiler return statement is necessary or not at function definition?
return statement from function definition to function call is necessary or not, while we return value from it(definition to call)?
#include<iostream>using namespace std;double add(double a, double b){ double c = a + b;}int main(){ double sum; sum = add(50.4,4.5); cout<<"sum is : "<<sum<<"\\n"; return 0; }Output issum is : nanMay i know why the ans is nan for double data type? Same has already worked for int. Is there any problem with double or float data type.
#include <stdio.h>#include <stdlib.h>int main(){int i;int sq;for(i=1; i<=10; i=i=1){ switch(i%2){case o: printf("%d is even.\\n", even); braek; case 1: printf("m% d is odd.\\n",i); braek; } } scanf("%s"); return 1;}this programm not running please tell me error
3329 visits
Outline:फंक्शन म्हणजे काय. फंक्शन च्या declaration साठी syntax आर्ग्युमेंट्स सहित फंक्शन उदाहरणार्थ :return-type function-name(parameter); आर्ग्युमेंट्स नसलेले फंक्शन उदाहरणार्थ : return-type function-name; फंक्शन कॉल करणे -एरर्स
फंक्शन म्हणजे काय. फंक्शन च्या declaration साठी syntax आर्ग्युमेंट्स सहित फंक्शन उदाहरणार्थ :return-type function-name(parameter); आर्ग्युमेंट्स नसलेले फंक्शन उदाहरणार्थ : return-type function-name; फंक्शन कॉल करणे -एरर्स
Show video info
Pre-requisite