-->

Facebook

Jasper Roberts - Blog

Wednesday, December 21, 2016

Write a C Program to find Gratest of 3 numbers to print the given no in ascending order.

void main()
{
     int a,b,c;
     clrscr();
     printf("enter the values of a,b and c");
    scanf("%d%d%d",&a,&b,&c);

   if(a<b && a<c)
  {
       if(b<c)
  {
       printf(" %d%d%d", a,b,c);
  }
 else if(b>c){
        printf(" %d%d%d",a,c,b);
  }
else if(b<c && b<a)
{
if(c<a)
       printf(" %d%d%d",b,c,a);
else
printf("%d%d%d",b,a,c);
}
else if(b<a)
         printf("%d%d%d",c,b,a);
else
         printf(%d%d%d",c,a,b);
}
}

OUTPUT:
Enter the values of a,b and c
6
4
5
4 5 6

Monday, December 19, 2016

Write a C Program to Find power of a number using recursion.

  1. #include<stdio.h>
  2. #include<conio.h>

  3. int main() {
  4. int pow,no;
  5. long int res;
  6. long int power(int,int);
  7. printf("Enter a number: ");
  8. scanf("%d",&no);
  9. printf("\n Enter power: ");
  10. scanf("%d",&pow);
  11. res=power(no,pow);
  12. printf("\n%d to the power %d is: %ld",no,pow,res);
  13. return 0;
  14. }
  15. int i=1;
  16. long int sum=1;
  17. long int power(int num,int pow) {
  18. if(i<=pow) {
  19. sum=sum*no;
  20. power(no,pow-1);
  21. } else
  22. return sum;
  23. }
OUTPUT:
Enter a number: 5
Enter power: 2
5 to the power 2 is: 25

Tuesday, December 13, 2016

Write a C program to print address of a variable

#include<stdio.h>
#include<conio.h>

void main( )
{

int a;
clrscr();
printf(“Address of a = %u“,&a);
getch();

}

OUTPUT:
Address of a =64453

Wednesday, December 7, 2016

Monday, November 28, 2016

Monday, November 7, 2016

CPU 2110003 GTU Question Bank for Winter 2016 Examination

Q – 1: Justify “C is Middle Level Language”.
Q – 2:Give the difference between:
a.        Compiler and Interpreter.
b.        Application software and system software.
c.        Call by value and call by reference.
Q – 3:What is an algorithm? Write an algorithm to display sum of n numbers.
Q – 4:What is flowchart? Explain various symbols used in Flowchart and draw the flowchart for
      finding smallest number out of three given numbers.
Q – 5: Explain various data types of C language.
Q – 6:Explain various operators used in C language.
Q – 7:Explain while…loop and do…while loop giving their syntax.
Q – 8:Explain if…else with suitable example.

Sunday, June 5, 2016

Welcoming Next Month - Java Programming

We are going to start java programming. We will upload daily java programs on website. Please visit regularly to know something new in java.

Wednesday, February 24, 2016

(IS2) Write a Program to implement-MODIFIED CEASER CIPHER

#include<stdio.h>
#include<conio.h>
void main()
{
            int i,no,c;
            char om[30],em[30];
            clrscr();
            printf("Enter Original Text: ");
            gets(om);
            printf("Enter Key No: ");
            scanf("%d",&no);
            c=no/26;
            if(no>26)
                        no=no-(c*26);
            for(i=0;om[i]!=NULL;i++)
            {
                        if(om[i]==' ')
                        {
                                    em[i]=' ';
                        }
                        else if(om[i]>='a' && om[i]<='z')
                        {
                                    em[i]=om[i]+no;
                                    if(em[i]>'z' || em[i]<0)
                                    {
                                                em[i]=em[i]-26;
                                    }
                        }
                        else
                        {
                                    em[i]=om[i]+no;
                                    if(em[i]>'Z')
                                    {
                                                em[i]=em[i]-26;
                                    }
                        }
            }
            em[i]=NULL;
            printf("\n Your Original Text = %s ",om);
            printf("\n Enter Encrypted Text = %s ",em);
            getch();

}


OUTPUT:

is programs

(IS1) - Write a Program to implement - CAESER CIPHER.

#include<stdio.h>
#include<conio.h>
void main()
{
            int i;
            char om[30],em[30];
            clrscr();
            printf("Enter Original Text: ");
            gets(om);
            for(i=0;om[i]!=NULL;i++)
            {
                        if(om[i]==' ')
                        {
                                    em[i]=' ';
                        }
                        else if(om[i]>='a' && om[i]<='z')
                        {
                                    em[i]=om[i]+3;
                                    if(em[i]>'z')
                                    {
                                                em[i]=em[i]-26;
                                    }
                        }
                        else
                        {
                                    em[i]=om[i]+3;
                                    if(em[i]>'Z')
                                    {
                                                em[i]=em[i]-26;
                                    }
                        }
            }
            em[i]=NULL;
            printf("\n Your Original Text = %s ",om);
            printf("\n Enter Encrypted Text = %s ",em);
            getch();
}




OUTPUT:
program to implement caeser cipher

Tuesday, February 23, 2016

2. Create web pages to illustrate text formatting tags

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>text formating</title>
</head>
<body>
<h1>This is Header1</h1>
<h2>This is Header2</h2>
<h3>This is Header3</h3>
<h4>This is Header4</h4>
<h5>This is Header5</h5>
<h6>This is Header6</h6>
<p>This is Paragraph</p>
<pre> This is pre formated text in html. it display text as it coped.</pre>
</body>

</html>

Output:


1. Write a html program to print "hello world"

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>hello world</title>
</head>

<body>
<h1 style="color:#FF0000"> Hello World </h1>
</body>

</html>

Output:

CPU 2110003 GTU Question Paper 30/12/2015

GTU CPU Question Paper - Exam Date: 30/12/2015 Click Here