Professional Documents
Culture Documents
table
of a given number
#include<stdio.h>
#include<conio.h>
void main()
{
int i,n;
clrscr(); //to clear the screen
printf(Enter any number:);
scanf(%d,&n);
printf(Table of %d is:n,n);
for(i=1;i<=10;++i)
printf(n%d*%d=%d,n,i,n*i);
getch(); //to stop the screen
}
Sub Main()
Dim N As Integer
N=1
{
int num,i,table=0;
clrscr();
printf("Enter any number: ");
scanf("%d",&num);
for(i=1;i<=10;i++)
{
table=num*i;
printf("%d * %d = %d\n",num,i,table);
}
getch();
}
Output:
Enter any number: 5
5*1=5
5 * 2 = 10
5 * 3 = 15
5 * 4 = 20
5 * 5 = 25
5 * 6 = 30
5 * 7 = 35
5 * 8 = 40
5 * 9 = 45
5 * 10 = 50
While N <= 5
Console.WriteLine("1x" + N.ToString +
" = " + N.ToString)
N=N*1
N=N+1
End While
Console.Write("Press enter to
continue")
Console.ReadLine()
End Sub
Output:
using System;
using System.Collections.Generic;
7*1=7
7 * 2 = 14
7 * 3 = 21
7 * 4 = 28
7 * 5 =35
7 * 6 = 42
7 * 7 = 49
7 * 8 = 56
7 * 9 = 63
using System.Linq;
7 * 10 = 70
Write a VB program to
accept the number
from
the user in text box
and
display multiplication
table of that number
into the list box.
Private Sub cmdClear_Click()
Text1.Text =
List1.Clear
Text1.SetFocus
End Sub
Private Sub cmdDisplay_Click()
Dim n, i As Integer
n = Val(Text1.Text)
For i = 1 To 10
List1.AddItem n * i
Next
End Sub
using System.Text;
namespace stringCont
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter Number to
find Multiplication");
int num =
Convert.ToInt32(Console.ReadLine());
for (int i = 1; i <= 10; i++)
{
int r = num * i;
Console.WriteLine(r.ToString());
}
Console.Read();
}
}
}
ByVal e As System.EventArgs)
Handles Button1.Click
End Sub
End Class
/* display part */
printf("\t\tUniversity of Rajasthan\n");
printf("\n\n");
printf("Roll No: %d \t Name : %s\n",rl,nm);
printf("--------------------------------------------------\n");
printf("Subject
Max
Min
Obt.Marks\n");
printf("--------------------------------------------------\n");
printf("Hist
100
36
%d\n",s1);
printf("socio.
100
36
%d\n",s2);
printf("Hindi
100
36
%d\n",s3);
printf("--------------------------------------------------\n");
printf("
Total
%d\n",t);
printf("per
%f\t\t\t
div: %s \n",per,div);
printf("--------------------------------------------------\n");
getch();
}
C# Program to Generate the Marksheet of the Student
This C# Program Generates the Marksheet of the Student. Here the student details
are obtained from the user and the marksheet is generated based on the details.
Here is source code of the C# Program to Generate the Marksheet of the Student. The C#
program is successfully compiled and executed with Microsoft Visual Studio. The program
output is also shown below.
1. /*
2. * C# Program to Generate the Marksheet of the Student
3. */
4. using System;
5. using System.Collections.Generic;
6. using System.Linq;
7. using System.Text;
8.
9. namespace Marksheet1
10. {
11.
class Program
12.
{
13.
static void Main(string[] args)
14.
{
15.
int r, m1, m2, m3, t;
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51. }
float p;
string n;
Console.WriteLine("Enter Roll Number :");
r = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter Student Name :");
n = Console.ReadLine();
Console.WriteLine("Mark of Subject1 : ");
m1 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Mark of Subject2 : ");
m2 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Mark of Subject3 : ");
m3 = Convert.ToInt32(Console.ReadLine());
t = m1 + m2 + m3;
p = t / 3.0f;
Console.WriteLine("Total : " + t);
Console.WriteLine("Percentage : " + p);
if (p >= 35 && p < 50)
{
Console.WriteLine("Grade is C");
}
if (p >= 50 && p <= 60)
{
Console.WriteLine("Grade is B");
}
if (p > 60 && p <= 80)
{
Console.WriteLine("Grade is A");
}
if (p > 80 && p <= 100)
{
Console.WriteLine("Grade is A+");
}
Console.ReadLine();
#include <stdio.h>
#include <conio.h>
void main ()
{
char name [50];
int clas, eng, nep, math, acc, cscience, total;
float per;
printf ("Enter the name of student:");
scanf ("% s", & name);
printf ("Enter the class:");
scanf ("% d", & clas);
printf ("Enter the marks in English, Nepali, Math, Account and Computer Science.");
scanf ("% d% d% d% d% d", & eng, & nep, & math, & acc, & cscience);
printf
printf
printf
printf
printf
printf
printf
printf
("\
("\
("\
("\
("\
("\
("\
("\
the Select Case control structure. However, the Select Case control structure is slightly different
from the If....ElseIf control structure .
The difference is that the Select Case control structure can handle conditions with multiple
outcomes in an easier manner than the If...Then...ElseIf control structure. If...Then...ElseIf
control structure basically used to handle a single condition having more than two outcomes.
Though If...Then...ElseIf control structure may also be used compute conditions with multiple
outcomes, we need to use more than two levels of nested If...Then...ElseIf statements, this can
make it difficult to read the codes. Therefore, the Select Case control structure is preferred when
there exist many different conditions.
The format of the Select Case control structure is show below:
Select Case expression
Case value1
Block of one or more VB statements
Case value2
Block of one or more VB Statements
Case value3
.
.
Case Else
Block of one or more VB Statements
End Select
Example 8.1
Dim grade As String
Private Sub Compute_Click( )
grade=txtgrade.Text
Select Case grade
Case "A"
result.Caption="High Distinction"
Case "A-"
result.Caption="Distinction"
Case "B"
result.Caption="Credit"
Case "C"
result.Caption="Pass"
Case Else
result.Caption="Fail"
End Select
End Sub
Example 8.2
Dim mark As Single
Private Sub Compute_Click()
'Examination Marks
mark = mrk.Text
Select Case mark
Case Is >= 85
comment.Caption = "Excellence"
Case Is >= 70
comment.Caption = "Good"
Case Is >= 60
comment.Caption = "Above Average"
Case Is >= 50
comment.Caption = "Average"
Case Else
comment.Caption = "Need to work harder"
End Select
End Sub
Example 8.3
how to download for free without any upload which was very simple and worked every time
with me.
Here am going to share how it all works,