Posts

Article on C Programming

What is C tokens ? What is Octal Number? What are %o, %x, %d? How to convert Integer to Octal ? What is Extern Variable ? How to manage Extern Variable in C?

C Programming Source Code Index

1. Write a program for performing as calculator which allows all Arithmetic Operators from terminal as input. Note: This program allows operators('+' , '-' , '*' , '/' , '%') and operands (Variables) as input from keyboard. 2. Write a C program to find the Simple Interest. Take input for principle amount, rate of interest and time from terminal. 3. Find the highest (maximum) and lowest (minimum) grades in an array of 25 integer grades. Print the array and print the highest and lowest grades, labeled appropriately. 4. Write a C Program to fill up an Integer Array. The length of the array must take from the terminal. After fill up the array do the following operations .

Print Prime and Sum

Write a C program to print all the prime numbers between 1 and 50 and sum of all printed primes.  

Digit split and sum

Write a program to split all the digit from a given integer input and make sum of all  digits. Sample Input: 13245 Sample Output: The digits are: 1 3 2 4 5 Sum: 6

Factorial in C

Write a program in c to find the factorial of a number #include <stdio.h> int main(){   int i=1,f=1,num;   printf( "Enter a number: " );   scanf( "%d" ,&num);   while (i<=num){       f=f*i;       i++;   }   printf( "Factorial of %d is: %d" ,num,f);   return 0; } Sample output: Enter a number: 5 Factorial of 5 is: 120 Do you know what is zero (0) Factorial ?

Calculate the Series

visit the problem source :  #include <stdio.h> #include<conio.h> int main () { int n,i,s,p,j; clrscr(); printf("Enter your range(n) :"); scanf("%d",&n); p=1; for (i=1;i<=n;i++) { s=0; for (j=1;j<=i;j++) { s=s+i; } p*=s; } printf("\n The value of p is =%d",p); getch(); return 0; } sample input/output: input : 4 output : The value of p is =576

Find Ascii Values

This prints out all acsii values void main () { int i ; i = 0 ; do { printf ( "%d %c \n" , i , i ); i ++; } while ( i <= 255 ); } This prints out the acsii value for a given character:   void main () { int e ; char ch ; clrscr (); printf ( "\n Enter a character : " ); scanf ( "%c" , ch ); e = ch ; printf ( "\n The ASCII value of the character is : %d" , e ); getch (); }