#include<stdio.h>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;}ByPooja.N.LECE departmentIRTT
Program
#include<stdio.h>int main( ){ int a,b; int diff; printf("Enter first number :"); scanf("%d",&a); printf("Enter second number :"); scanf("%d",&b); if(a>b) diff=a-b; else diff=b-a; printf("\n Difference between %d and %d is=%d",a,b,diff); return 0;}ByKeerthi vennila SEce departmentIrtt
#include <stdio.h>int main(){ int a,b; int diff; printf("Enter first number: "); scanf("%d",&a) printf("Enter second number: "); scanf("%d",&b) if( a>b ) diff=a-b; else diff=b-a; printf("\n Difference between %d and %d is = %d", a, b, diff); return 0;}BYShamraj Babu.TECE DepartmentIRTT
#include <stdio.h>int main(){ int a,b; int diff; printf("Enter first number: "); scanf("%d",&a); printf("Enter second number: "); scanf("%d",&b); if( a>b) diff=a-b; else diff=b-a; printf("\nDifference between %d and %d is = %d", a,b,diff); return 0;}By M. Bala priyadharshini ECE department IRTT
#include<stdio.h>int main( ){ int a,b; int diff; printf("Enter first number :"); scanf("%d",&a); printf("Enter second number :"); scanf("%d",&b); if(a>b) diff=a-b; else diff=b-a; printf("\n Difference between %d and %d is=%d",a,b,diff); return 0;}
Why is the following code wrong? Why can't the main function return float data type? What to do if we have to find the difference between two floating numbers?Please explain.#include <stdio.h>void difference(float a, float b){ float c = a-b; printf("The difference between x and y is %f\n", c);}float main(){ float x,y; printf("Enter the number 1:"); scanf("%f", &x); printf("Enter the number 2:"); scanf("%f", &y); difference(x,y); return 0;}
What is the difference between a global declaration and Extern. How it differs as both does the same operation
what is the use of namespace in scope of variables?
984 visits
Outline:ಸಾರಾಂಶ: ಸ್ಕೋಪ್ ಆಫ್ ವೇರಿಯೇಬಲ್ಸ್ -ಪರಿಚಯ -ವೇರಿಯೇಬಲ್ ಅನ್ನು ಡಿಕ್ಲೇರ್ ಮಾಡಲು ಇರುವ ಸಿಂಟಾಕ್ಸ್ --ಉದಾಹರಣೆಗೆ: data-type var-name; -ವೇರಿಯೇಬಲ್ ಅನ್ನು ಇನಿಶಿಯಲೈಸ್ ಮಾಡಲು ಇರುವ ಸಿಂಟಾಕ್ಸ್ --ಉದಾಹರಣೆಗೆ: data-type var-name = value; -ವೇರಿಯೇಬಲ್ ನ ಸ್ಕೋಪ್ ಗಳು -ಗ್ಲೋಬಲ್ ವೇರಿಯೇಬಲ್ -ಲೋಕಲ್ ವೇರಿಯೇಬಲ್ -ದೋಷಗಳು
ಸಾರಾಂಶ: ಸ್ಕೋಪ್ ಆಫ್ ವೇರಿಯೇಬಲ್ಸ್ -ಪರಿಚಯ -ವೇರಿಯೇಬಲ್ ಅನ್ನು ಡಿಕ್ಲೇರ್ ಮಾಡಲು ಇರುವ ಸಿಂಟಾಕ್ಸ್ --ಉದಾಹರಣೆಗೆ: data-type var-name; -ವೇರಿಯೇಬಲ್ ಅನ್ನು ಇನಿಶಿಯಲೈಸ್ ಮಾಡಲು ಇರುವ ಸಿಂಟಾಕ್ಸ್ --ಉದಾಹರಣೆಗೆ: data-type var-name = value; -ವೇರಿಯೇಬಲ್ ನ ಸ್ಕೋಪ್ ಗಳು -ಗ್ಲೋಬಲ್ ವೇರಿಯೇಬಲ್ -ಲೋಕಲ್ ವೇರಿಯೇಬಲ್ -ದೋಷಗಳು
Show video info
Pre-requisite