ad

Tuesday, February 25, 2025

C Program Print Right Half Pyramid pattern

c program

C Program  Print Right Half Pyramid pattern


Q.1] C Program  Print Right Half Pyramid pattern

Examples :-     

#include<stdio.h>
#include<conio.h>
int main()
{
int i,j,row;
printf("enter the number");
scanf("%d",&row);
for(i=1;i<=row;i++)
{
for(j=1;j<=i;j++)
{
printf("*");
}
printf("\n");
}
return 0;
}



 Q.1] C Program  Print Right Half Pyramid pattern
 Program Output ;-  Run 1 Time 

Q.1] C Program  Print Right Half Pyramid pattern   Program Output

 Q.1] C Program  Print Right Half Pyramid pattern
 Program Output ;-  Run 2 Time 


Q.1] C Program  Print Right Half Pyramid pattern   Program Output


Related Post :-

javascript assignment operators

PHP Program to print Alphabet Pattern


Monday, February 24, 2025

C Program to Check Whether a People is Eligible to Vote or Not

                     C Program  

C Program to Check Whether a People is Eligible to Vote or Not


Q.1] C Program to Check Whether a People is Eligible to Vote or Not  

Example  :-

#include<stdio.h>
 #include<conio.h>
int main()
{
int age;
clrscr();
 printf("enter your age :-");
scanf("%d", &age);
if(age>=18)
{
printf("you are eligible to vote");
}
else
{
printf("you are not eligible for vote");
}
getch();
return 0;
}


Q.1 ]C Program to Check Whether a People is Eligible to Vote or Not  

 Program Output :- Run 1 time

enter your age :- 18 
you are eligible to vote 

 Program Output :- Run 2 Time

enter your age :-  15
you are  not eligible foe vote 


 Program Output :- Run 3 Time

enter your age :-  21
you are eligible to vote 

Related Post :-

type of css

php syntax

c program to check number prime or not

Sunday, February 23, 2025

C Program To Print Day of Week using If else case in switch case

c program     



C Program To Print Day of Week using If else case  in switch case


 Q. ] C Program To Print Day of Week using  switch case

Example :-


#include<stdio.h>
#include<conio.h>
void main()
{
int num;
clrscr();
printf("enter a number between 1 to 7 :-");
num=getchar ()-'0';
if (num>=1&& num<=7)
{
switch(num)
{
case 1:
printf("monday \n");
break;
case 2:
printf("tuesday \n");
break;
case 3:
printf("wednesday \n");
break;
case 4:
printf("Thursday \n");
break;
case 5:
printf("Friday \n");
break;
case 6:
printf("Saturday \n");
break;
case 7:
printf("Sunday \n");
break;}
}
else{
printf("enter number between 1 to 7");
}
getch();
}



Q. ] C Program To Print Day of Week using  switch case

Output :-

Enter a number between 1 ro 7 :-  5
Friday 


Related post :-

javascript do while loop

Project navigation bar page

php number increasing reverse pyramid


Saturday, February 22, 2025

c program to check number is even or odd use if else

                       c program




c program to check number is even or odd use if else


c program to check number is even or odd

Examples :-

// even or odd program if else //if else statement statement only allows // program to execute one block of code if a check condition // is true than execute the block or condition is false than exite the block // of code. #include<stdio.h> int main() { int number= 0; printf("enter a number"); scanf("%d",&number); if(number %2 ==0 ) { printf("%d is even"); } else { printf("%d is odd"); } return 0; }


  1. ] c program to check number is even or odd

Output 

enter a number  
7 is Odd

  1. ] c program to check number is even or odd

Output 

enter a number 

2 is even


Related post :-

c program add two integer number

left pascal star pattern in php

Friday, February 21, 2025

C Program to Check Number is prime or Not prime

                                      C Program 





C Program to Check Number is prime or Not prime

1] C Program to Check Number is prime or Not prime

Examples :-

#include<stdio.h>
#include<conio.h>
void main()
{
int a, i, flag=0;
printf("enter a positive integer");
scanf("%d", &a);
if(a==0||a==1)
flag=1;
for(i=2;i<=a/2;i++)
{
if(a%i==0)
{
flag =1;
break;
}
}
if (flag==0)
printf("%d is prime number ", a);
else
printf("%d is not prime number",a);
getch();
return 0;
}


C Program to Check Number is prime or Not prime

Output 

 enter a positive integer 133
   133 is not prime number

C Program to Check Number is prime or Not prime

Output 

 enter a positive integer 61
  61 prime number


Thursday, February 20, 2025

C Program to Add Two Integers number

                                        C Program 




C Program to Add Two Integers number

1] C Program to Add Two Integers number 

Examples :-

#include<stdio.h>
#include<conio.h>
int  main()
{
int  V, W, sum =0 ;
printf("Enter Two number integer:");
scanf( "%d%d", &V, &W );
sum=V+W;
printf( "sum %d",sum );
getch();
return 0;
}

C Program to Add Two Integers number

Output 


 Enter Two number integer :

    5
    5
  Sum =10


2] C Program to Add Three Integers number

Examples :-

#include<stdio.h>
#include<conio.h>
int  main()
{
int V,W,sum =0;
printf("Enter Two number integer:");
scanf( "%d%d", &V,&W,&X );
sum=V+W+X;
printf( "sum %d",sum );
getch();
return 0;
}

C Program to Add Three Integers number

Output 

Enter Two number integer :
    5
    5
    5
Sum =15



Friday, February 14, 2025

What is the C language

 
               What is the C language

What is the C language



  1]    full form  c stands for computer programming  language .

  2] C language  developed and father by Dennis Ritchie at the  Bell Laboratories in 1972 .

  3] C is widely use programming language they are important for the c is low level programming       efficiency simplicity and flexibly, portability influence, system and application software embedded  system, large ecosystem, interfacing with hardware is programming language .

 4] C Is a general-purpose programming language.

 5] C is middle level programming language.

  6] Used c language developing computer software, system programming, application, games such as windows and complicated programs such oracle database, python, git, interpreter

 7] C is an imperative procedural language supporting structured programming.

 8] C language is a procedural and general-purpose programming language.

 9] C is portable assembly language. designed to ease to implementation of compiler the produce high quality code

 10] C uses t0 blocks to separate pieces of code that performing different tasks that helps easier clean code and easier to understand and easy to find  mistake of program

 11] C allows low level memory access provide simple  and clean structure.

C Program Structure 

#include<stdio.h>

#include<conio.h>

int main()

{

printf(" Hi Friend");

return 0;

}

Output :- 

Hi Friend

Related Post :-

php echo function

Creating Sample Customer order Form Using HTML

css column gap property


Sunday, February 9, 2025

Top 10 html MCQ with Answers

Top 10 HTML  MCQ With Answers 

Top 10 html MCQ with Answers


1]  CSS  full form?

  1.  color and style sheets
  2. Cascade style sheets
  3. Cascading style sheets
  4. None of the above

Answer: 3) Cascading style sheets

2] Which of the following is the correct syntax for external style sheet?

  1. <style src="example.css>
  2. <style src= example.css>
  3. <stylesheet> example.css </stylesheet>
  4. <link rel="stylesheet" type="text/css" href="main.css">

Answer: 4) <link rel="stylesheet" type="text/css" href="main.css"

3] The property in CSS use to change the background color of element ?

  1. bgcolor
  2. background-color
  3. color
  4. All of the above

Answer: (c) background-color

4] The property in CSS use to change the text color of  element

  1. bgcolor
  2. background-color
  3. color
  4. All of the above

 Answer: 3) color

5) The CSS property use to control the element font-size

  1. text-size
  2. text-style
  3. font-size
  4. None of the above

Answer: 3 ) font-size

6] The HTML attribute use to define the inline styles

  1. styles
  2. style
  3. class
  4. None of the above

Answer: 2) style

7]  The HTML attribute use to define the internal stylesheet

  1. <style>
  2. style
  3. <link>
  4. <script>

Answer: (a) <style>

8] Which of the following CSS property is use to set the background image of element?

  1. background-attachment
  2. background- color
  3. background-image
  4. None of the above

Answer: 3) background-image

9] How to create an unordered list in HTML?

  1. <ul>
  2. <li>
  3. <ol>
  4. <i>

Answer: 1) <ul>

10]  Which character is use to represent the closing of a tag  HTML?

  1. \
  2. !
  3. /
  4. \\

Answer: 3) /


Related Post :-

how to create login form

php program to print hear star pattern

css border property

Saturday, February 8, 2025

Top 15 html MCQ with Answers

Top 15 HTML  MCQ With Answers 





1] What is the purpose of the <a> 

A)  To insert images
B) To define a paragraph
C) To create a hyperlink
D) To create headings

Answer: C) To create a hyperlink

 2] <a> tag specifies URL of the link destination

A) link
B)  src
C)  url
D) href

Answer: D) href

3] Which of the  NOT a valid target value for the <a> tag 

A) _parent
B) _top
C) _newtab
D) _self

Answer: C) _newtab

4] Which tag is commonly used with <a>  tag to define navigation link?

A) <nav>
B) <section>
C) <header>
D) <footer>

Answer: A) <nav>

5] What attribute is used to group radio buttons 

A) value
B) group
C) name
D) id

Answer: C) name

6] How can you hide a radio button but functional?

A) display: none;
B) visibility: hidden;
C) opacity: 0;
D) Both A and C

Answer: D) Both A and C

7]  HTML element for creating a dropdown list?

A) <dropdown>
B)  <option>
C)<select> 
D) <list>

Answer: C) <select>

8] Which tag is usedto define individual items inside a dropdown 

A) <list>
B) <option>
C) <dropdown-item>
D) <item>

Answer: B) <option>

9] Which attribute defines the default value submitted with a dropdown LIST ?

A) value
B) default
C) selected
D) name

Answer: A) value

10] assign a name to a dropdown in a form?

A) Use id="dropdown"
B) Use name="dropdown"
C) Use label="dropdown"
D) Use value="dropdown"

Answer: B) Use name="dropdown"

11] How can you group related options in a dropdown 

A) Using <group>
B) Using <fieldset>
C) Using <optgroup>
D) Using <category>

Answer: C) Using <optgroup>

12] How can you create a dropdown with a custom button instead of a <select> ?

A) Using <button> and JavaScript
B) Using <input type="dropdown">
C) Using <menu> and <option>
D) Using <drop-button>

Answer: A) Using <button> and JavaScript

13] How can you prevent use from selecting a particular option  dropdown?

A) Add disabled to the <option>
B) Add hidden to the <option>
C) Add readonly to the <option>
D) Both A and B

Answer: D) Both A and B

14]  HTML tag to create a file upload input?

A) <upload>
B) <file>
C) <input type="file">
D) <input type="upload">

Answer: C) <input type="file">

15] Which attribute is required for selecting multiple files in  upload field?

A) multiple
B) multiselect
C) select="multiple"
D) multi-file

Answer: A) multiple

Related  Post :-

php if else statements

php program to print alphabet pattern U

javascript Tutorial

Friday, February 7, 2025

Top 20 html MCQ with Answers

 

Top 20 HTML  MCQ With Answers 



1] <form> tag  specifies where to send form data

A) action
B) enctype
C)method
D) target

Answer: A) action

2] <form> tag specifies how form data should be sent?

A) enctype
B) method  action
C) method 
D) name

Answer: C) method

3] What are the valid value for the method attribute


A) get, send
B)send, receive
C) get, post
D) send, post 

Answer: C) get, post

3] default method if the method attribute is not specified?

A) POST  DELETE
B) PUT
C) GET
D) POST 

Answer: C) GET

4] Which input type is use for passwords?

A) text
B) password
C) secure
D) pass

Answer: B) password

5] Which element is used to create a dropdown menu in a form?

A) <dropdown>
B) <select>
C) <option>
D) <checkbox>

Answer: B) <select>

6] Which attribute makes an input field required?

A) required
B) mustfill
C) validate
D) mandatory

Answer: A) required

7] What input type allow users to select multiple options?

A) checkbox
B)  button
C) text
D) radio

Answer: A) checkbox

8] What does the name attribute in an input tag 

A) Gives a unique ID
B) Defines a CSS class
C) Identifies the input when sending data
D) Specifies the type of input

Answer: C) Identifies the input when sending data

9] create a multi-line text input field

A) <textarea>
B) <paragraph>
C) <text>
D) <paragraph>

Answer: A) <textarea>

11]  Which tag groups form element together?

A) <group>
B) <fieldset>
C)  <section>
D) <formgroup>

Answer: B) <fieldset>

12] What does the <legend>  

A)   Adds a title to a form
B) Groups options in a dropdown
C) Provides a caption for <fieldset>
D) Defines a label for an input 

Answer: C) Provides a caption for <fieldset>

13] Which tag is use to define a label for an input field

A) <text>
B) <name>
C) <label>
D) <input>

Answer: C) <label>

15] How do you associate a label with an input field

A) Using for attribute in <label>
B) Using id attribute in <input>
C) Both A and B

Answer: C) Both A and B

16] input type restricts users to selecting a date

A) text
B)  datetime
C) calendar
D) date

Answer: B) date

17] Which attribute sets a maximum value for an input field

A) max
B)   value
C) limit
D) maximum

Answer: A) max

 18] input type is used for numeric input

A) number
B) numeric
C) tex
D)  integer

Answer: A) number

 19] What does the <ol> tag stand

A) Ordered Listing

B) Ordered Link

C) Ordered List

D) Online List

Answer: C) Ordered List

20] Which tag is use to define an item inside an ordered list

A) <item>

B) <ol>

C) <li>

D) <ul>

Answer: C) <li>

Wednesday, February 5, 2025

Top 10 HTML MCQ With Answers part(10)

  

Top 10 HTML  MCQ With Answers 


Top 10 HTML  MCQ With Answers part(10)

1] Where should the <script> tag be placed when linking an                                       external JavaScript file?

A) Inside <head>
B) Inside <body>
C) Before </html>
D) Any of the above

Answer: D) Any of the above


2] How do you correctly link an external JavaScript ?

A) <script src="script.js"></script>
B) <link rel="script" href="script.js">
C) <meta script="script.js">
D) <js src="script.js"></js>

Answer: A) <script src="script.js"></script>


3] Which tag is use to define the favicon for a website?

A) <meta icon>
B) <favicon>
C) <link rel="icon">
D) <icon> 

Answer: C) <link rel="icon">


4] What file types are commonly use for favicons?

A) .png
B) .ico
C) .svg
D) All of the above

Answer: D) All of the above


5] What is the default size of  favicon?

A) 16x16
B) 32x32
C) 64x64
D) 128x128

Answer: A) 16x16


6] Why is the  important<meta charset="UTF-8"> tag ?

A) Ensures proper character encoding
B) Loads stylesheets faster
C) Increases SEO ranking
D) Prevents broken links

Answer: A) Ensures proper character encoding


7] What does the <base> tag do in the <head> tag?

A) Sets the base URL for all relative links
B) Defines the primary content
C) Sets the background color
D) Specifies the document type

Answer: A) Sets the base URL for all relative links


8] What happens if the <title> tag is missing from the <head> tag?

A) The browser shows a blank tab title
B) The file name is displayed as the title
C) The webpage doesn’t load
D) The browser crashes

Answer: B) The file name is displayed as the title

9) How do you make a frame load a default web page?

a) By using the src attribute
b) By using the href attribute
c) By using the load attribute
d) By using the default attribute

Answer: a) By using the src attribute

10] What happens if the cols and rows attributes are not specified in a <frameset>?

a) The browser displays a blank page
b) Frames take up equal space by default
c) Frames do not appear
d) Frames are automatically hidden

Answer: b

Tuesday, February 4, 2025

Top 10HTML MCQ With Answers(part 9)

Top 10 HTML  MCQ With Answers 

Top 10HTML  MCQ With Answers(part 9)



1] correct html tag to display an image?  

  a) <image>    b) <img>    c) <picture>   d) <src>

Answer : b) <img>

2] <img> tag attribute
   a) src
  b) title
  c) href
  d) a
 Answer a) src 

3]  Syntax for a HTML comment?

  a)  //comment
  b)  /* comment */
  c)  <!-- comment -->
  d) { comment }

Answer c) <!-- comment-->


4]  Correct HTML tah for creating a table?

   a)  <tr>
   b)  <td>
   c)  <th>
   d) <table>

Answer d) <table>

5] what tag use define a row html table?

     a) <tr>
     b) <td>
     c)  <th>
     d) <row>

Answer a) <tr>

6)  what tag use define cell inside table row

    a) <tr>
    b) <row>
    c) <td>
    d) <table>

Answer c) <td>

7] force extra spaces in a paragraph?

 
    a) nbsp;  b) <br>  c) <space>  d) text-space

Answer a) &nbsp;       

 8] add a line break inside a paragraph?

   a) <p>  b) <paragraph>  c) <text>  d)  <para>

Answer a) <p>


9) align  text inside a <p> tag?

   a) text-align in css b) align="center" in html  
  c) Both a & b         d) <p align="middle">

Answer c) both a and b


10) how do you change the text color inside a <p> tag using css?

 a) color   b) text-color  c) style-color  d) font-color

Answer a)color

Related Post :- 

program to print left pascal star pattern in php