Posts

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 (); }

Goto in C

Image
#include <stdio.h> #include <conio.h> int  main () {    int  n =  0 ;    loop: ;      printf ( "\n%d" , n ) ;    n++;    if  ( n< 10 ) {    goto  loop;    }    getch () ;    return  0 ; }

Float Array

Image
#include <stdio.h> #include<conio.h> int main() { int i; float fArray[4]; clrscr(); for (i = 0; i < 4; i++) { printf("Please enter a float: "); scanf("%f", fArray[i]); } getch(); return 0; } output:

Matrix in C

Write a program for the addition of a 2*2 matrix.   Source Code:

Function in C

Write a program to show the advantage of using function in a program Source Code:

Break and Continue in C

Differentiate between break and continue using C source code Source code:

Sum the selected digits

If a four digit integer number is input through the keyboard then write a c program to find the sum of first and last digit. Sample Input: 3254 Output: 7 Hints: 3(1st digit)+4(last digit)=7  Source Code: