Day 5 : Assaignment for All // Write a programm for below questions.

 

Assaignment on variables and data types in c lang


This post discusses assignments for all of u on the basic of c programming. 


in the first question, we are accepting input value from the user and showing that value on our terminal.


Learn Previous Chapter: 

Day-1: What is programming and Basics of c programming.Day 2: Structure of c and Input, Output in c programming.Day 3: Variable and Data types in the C language.



1./* WAP to input a person's age and Display the value */ Write 5 programs like this with float, int, char & string values;


Assaignment 1




Ex: 


#include <stdio.h>

#include<conio.h>


int main(){

int age;

printf("Enter our Age: ");

scanf("%d",&age);

printf("THis is your age: %d",age);

}



*******************


2. /* WAP to display the min and max value for the datatype */



Assaignment-2




 Hints --> Add limits.h & float.h header file in your code.


<climits>(limits.h) defines sizes of integral types. 

This header defines constants with the limits of fundamental integral types for the specific system and compiler implementation.


The limits for fundamental floating-point types are defined in <cfloat> (<float.h>). 

The limits for width-specific integral types and other typedef types are defined in <cstdint> (<stdint.h>).



use this for reference: -https://www.geeksforgeeks.org/climits-limits-h-cc/


Example: - 

printf("Minimum Value Of character is: %d" , INT_MIN);


Post a Comment

Previous Post Next Post