Skip to main content

Posts

KG to Pound Conversion [C Programming]

#include<stdio.h> int main() {     float kg, p;     printf("Enter weight in KG: ");     scanf("%f", &kg);     p = kg*2.20462;     printf("%0.2f KG = %0.2f Pound", kg, p);     return 0; }
Recent posts

Take a 5 Digit Integer Number & Print It in Reverse Order [C Programming]

#include<stdio.h> int main() {     int i, a, b, c, d, e, f, g, h, rev;     printf("Enter a 5 digit integer number: ");     scanf("%d", &i);     a = i/10000;     b = i%10000;     c = b/1000;     d = b%1000;     e = d/100;     f = d%100;     g = f/10;     h = f%10;     rev = h*10000+g*1000+e*100+c*10+a;     printf("Reverse number: %d", rev);     return 0; }

Program That Reads & Sums Data Values Until A Negative Value Is Read [C Programming]

#include<stdio.h> int main() {     int i, sum=0;     while(1)     {         printf("Enter a number: ");         scanf("%d", &i);         if(i>=0)         {             sum += i;         }         else         {             break;         }     }     printf("Sum : %d", sum);     return 0; }

Program to Read The Age of n Persons & Count The Number of Persons Who Are Not in The Age Group 50-60 [C Programming]

#include<stdio.h> int main() {     int i, n, age, count=0;     printf("How many person's age do you want to insert?\n");     scanf("%d", &n);     for(i=1; i<=n; i++)     {         printf("Enter age of person %d: ", i);         scanf("%d", &age);         if(age < 50 || age > 60)         {             count++;         }     }     printf("\nNumber of person(s) who are not in age group 50 - 60 is: %d", count);     return 0; }