C Function Kilo Bytes to Bytes

By | July 24, 2023

C Function Kilo Bytes to Bytes – C Program to convert kilo bytes into bytes using a user defined function.

C Program to convert kilo bytes into bytes using a user defined function

C Program to convert kilo bytes into bytes using a user defined function

Source Code

 

#include <stdio.h>

int kb2byte(int kb)
{
	return kb * 1024;
}
int main() 
{
    int k,b;
    
    printf("Enter Kilo Bytes to convert into Bytes:");
    scanf("%d",&k);
    
    b = kb2byte(k);
    
    printf("%d KB = %d Bytes",k,b);
    
    return 0;
}
    

Output of Program Execution

Enter Kilo Bytes to convert into Bytes:4
4 KB = 4096 Bytes
——————————–
Enter Kilo Bytes to convert into Bytes:200
200 KB = 204800 Bytes
——————————–

Loading

Leave a Reply

Your email address will not be published. Required fields are marked *