Online Examination System for all learner!!! coming soon..

Showing posts with label C. Show all posts
Showing posts with label C. Show all posts

VB 6.0: Design a form contains a sorted list alphabetically.

Design a form contains a sorted list alphabetically such that the user can add the item from text to the list after click on command button "add".
Sol:
//for more program please visit www.programtubenotes.blogspot.in 
Private Sub Form_Load()
    List1.List=""

   List1.Sorted=True
   Text1.Text=""
    Command1.Vaption="add"
 End Sub
Private Sub Command1_Click()
list1.AddItem (Text1.Text)
Text1.Text = " "
End Sub


Output:-
after Run the get this window


C : Program to check given number is armstrong or not.

Code:

#include<stdio.h>
#include<conio.h>
main()
{
        int n,x;
        printf("Enter a number:");  
        scanf("%d",&n);
        x=armstrong(n);
        if(x==n)
                printf("Arm strong");
        else
                printf("Not arm strong");
}

int armstrong(int num)
{
        int sum=0,r;
        while(num!=0)
        {
                r=num%10;
                num=num/10;
                sum=sum+(r*r*r);
        }
        return sum;
}


Output:

Enter a number:1

Arm strong 

C Programming Online Test 1

Following quiz provides Multiple Choice Questions (MCQs) related to C Programming Framework. You will have to read all the given answ...